﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
6263	SetEnv not supported in mod_python	eraoul	nobody	"
{{{
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.
}}}
"		closed	Documentation	dev		invalid	mod_python settings SetEnv		Unreviewed	0	0	0	0	0	0
