简体   繁体   中英

Django python path with Apache and mod_python

I'm trying to set up Review Board, which uses Django, on WinXP with Apache 2.2 and mod-python.

I have a default Python install, but I want to use a different instance. The default is c:/python25, but I want d:/xxx/python25. mod-python has a config option to change the path, but I don't want to have to recompile mod_python (as the code is in VCS and could be put anywhere). How can I fix this?

Currently I'm trying to change the environment path using SetEnv in the Apache conf file, eg

SetEnv PATH "d:/xxx/python25;PATH"
LoadModule python_module modules/mod_python.so

Ie setting the environment variable before mod-python is loaded as this is where it finds the Python interpretter.

This doesn't seem to work. Is the syntax wrong? Is there another solution?

Thanks.

If you're on windows, it's possible it's referencing the registry for the path. Try looking in the registry under:

HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5

In particular, the subkeys, InstallPath , Modules , and PythonPath .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM