SetEnv not supported in mod_python
|Reported by:||eraoul||Owned by:||nobody|
|Severity:||Keywords:||mod_python settings SetEnv|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The docs say that the DJANGO_SETTINGS_MODULE environment variable should be set using SetEnv in an Apache "Location" directive, as follows: <Location "/mysite/"> SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE mysite.settings PythonDebug On </Location> However, I get an error message that the DJANGO_SETTINGS_MODULE env. var is undefined. After several hours of debugging, and finding another person with the same problem but without a resolution, I found the following note in the mod_python FAQ itself: "Environment. The apache SetEnv & PassEnv (etc) directives have no effect on the os.environ seen by mod_python. If you need to pass environment to mod_python, you need to set it before starting apache. Or consider using the PythonOption apache directive to pass config info into mod_python scripts." So, can anyone recommend the best way to get DJANGO_SETTINGS_MODULE set up correctly? It seems that SetEnv is not correct here.
Change History (1)
Note: See TracTickets for help on using tickets.