ahhhh....
that makes sense :)
>
> Make sure you set PRODUCTION/INTERNET in all application
> configurations. Ie., add:
>
> SetEnv PRODUCTION true
> SetEnv INTERNET true
>
> or whatever it needs to be in other configurations.
hmm, I'm not sure if that solves the problem or not.
It seems less frequent but it does happen.....
is there a way to pass options to the site with mod_python without
relying on environment variables?
Regards
Stephen
The problem with that becomes let's say I have the two options
production and internet, then that means that I have to have 4
different settings.py for each combination.
I did find an interesting idea here
http://www.modpython.org/pipermail/mod_python/2006-June/021316.html
just then.
basically you modify PythonPath depending on what features you want.
For example, say I have a file hierarchy like so
options/
debug/
production/
__init__.py
apacheSettings.py
#In here set PRODUCTION=True
dev/
__init__.py
apacheSettings.py
#In here set PRODUCTION=False
internet/
on/
__init__.py
apacheSettings.py
#In here set INTERNET=True
off/
__init__.py
apacheSettings.py
#In here set INTERNET=False
then in settings.py
PRODUCTION = True
try:
import apacheSettings
PRODUCTION = apacheSettings.PRODUCTION
except ImportError:
pass
INTERNET = True
try:
import internetSettings
INTERNET = internetSettings.INTERNET
except ImportError:
pass
and finally, in apache configuration
PythonPath " \
[ \
'/home/iambob/web/options/debug/production', \
'/home/iambob/web/options/internet/on', \
'/home/iambob/web', '/home/iambob/web/common', '/home/iambob/web/home'\
] + sys.path"
or
PythonPath " \
[ \
'/home/iambob/web/options/debug/dev', \
'/home/iambob/web/options/internet/off', \
'/home/iambob/web', '/home/iambob/web/common', '/home/iambob/web/home'\
] + sys.path"
which seems to work rather nicely
:)
so more research has finally led me to the real problem.
http://docs.djangoproject.com/en/dev/howto/deployment/modpython/
I had the PythonInterpreter setting in the apache configurations to
the same value. Changing it to a different value for the production
and development versions solved the problem :)