B. Additional materials¶
B.1. cx_Oracle driver installation on Debian and an example of Smarty to Oracle connection setup¶
Install the package
oracle-instantclient11.2-basic
.When installing on Debian you need to convert the rpm package provided by Oracle into deb package using the utility
alien
:alien oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm dpkg -i oracle-instantclient11.2-basic_11.2.0.4.0-2_amd64.deb
Install the package
oracle-instantclient11.2-devel
:alien oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm dpkg -i oracle-instantclient11.2-devel_11.2.0.4.0-2_amd64.deb
Install the package
oracle-instantclient11.2-sqlplus
:alien oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm dpkg -i oracle-instantclient11.2-sqlplus_11.2.0.4.0-2_amd64.deb
Install the python module
cx_Oracle
:pip install cx_Oracle
Install
libaio1
:apt-get install libaio1 libaio-dev
B.1.1. Smarty to Oracle connection setup¶
This is needed to be written into the database connection settings section of the Smarty configuration file:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.oracle',
'NAME': "smarty",
'USER': "smarty", # Имя схемы/пользователя
'PASSWORD': "password", # Пароль пользователя
'HOST': "10.0.0.10", # Адрес сервера Oracle
'PORT': '1521',
'OPTIONS': {
'threaded': True,
'use_returning_into': False,
},
'CONN_MAX_AGE': 600,
}
}
B.2. Настройка подключения Smarty к PostgreSQL¶
This is needed to be written into the database connection settings section of the Smarty configuration file:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'smarty',
'HOST': 'localhost',
}
}
Параметр Host является обязательным. Также для PostgreSQL появляется новая зависимость: psycopg2. Устанавливается через pip:
pip install psycopg2-binary