You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.../lib/python3.6/site-packages/django_informixdb/base.py in get_connection_params, line 192
Environment:
Ubuntu 16.04.02
Apache 2.4.18
mod_wsgi 4.6.5
Django 2.1.3
Python 3.6.7
$INFORMIXSQLHOSTS is Set
sqlhosts file is correct.
Analysis
Connection to Informix works, when project hosted by django dev server: ./manage.py runserver; but under Apache it doesn't.
My Idea is that Apache runs the project in a separate thread, hiding the host env.vars for the security purposes, so django_informixdb can't reach $INFORMIXSQLHOSTS
Possible solutions:
Set path to sqlhosts file in the django.settings.DATABASES
Generally I think that all the variables for django_informixdb should be in django.settings.DATABASES, instead of getting them from environment.
In that case:
information is explicitly described
could be stored in git/svn/etc
user could use different variables to connect for several Informix servers.
Error:
Cannot find Informix sqlhosts at None
.../lib/python3.6/site-packages/django_informixdb/base.py in get_connection_params, line 192
Environment:
$INFORMIXSQLHOSTS
is Setsqlhosts
file is correct.Analysis
Connection to Informix works, when project hosted by django dev server:
./manage.py runserver
; but under Apache it doesn't.My Idea is that Apache runs the project in a separate thread, hiding the host env.vars for the security purposes, so django_informixdb can't reach
$INFORMIXSQLHOSTS
Possible solutions:
sqlhosts
file in thedjango.settings.DATABASES
Generally I think that all the variables for
django_informixdb
should be indjango.settings.DATABASES
, instead of getting them from environment.In that case:
$DB_LOCALE
, which could be different for each DB.If the developer wants to be more flexible and use envars instead of hardcoding, he could use
os.environ
:But information is still explicit and anybody could understand, where is it taken from.
The text was updated successfully, but these errors were encountered: