SetEnv not supported in mod_python
The docs say that the DJANGO_SETTINGS_MODULE environment variable should be set using SetEnv in an Apache "Location" directive, as follows:
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
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)
Changed 7 years ago by Karen Tracey <kmtracey@…>
Patch needs improvement
set to invalid
changed from new to closed