简体   繁体   English

使用Apache和mod_python的Django python路径

[英]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. 我正在尝试在具有Apache 2.2和mod-python的WinXP上设置使用Django的Review Board。

I have a default Python install, but I want to use a different instance. 我有默认的Python安装,但是我想使用其他实例。 The default is c:/python25, but I want d:/xxx/python25. 默认值为c:/ python25,但我想要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). mod-python有一个config选项可以更改路径,但是我不想重新编译mod_python(因为代码在VCS中,可以放在任何地方)。 How can I fix this? 我怎样才能解决这个问题?

Currently I'm trying to change the environment path using SetEnv in the Apache conf file, eg 目前,我正在尝试使用Apache conf文件中的SetEnv更改环境路径,例如

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. 即在加载mod-python之前设置环境变量,因为它是在其中找到Python解释器的地方。

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. 如果您使用的是Windows,则可能是引用注册表的路径。 Try looking in the registry under: 尝试在注册表下查找:

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

In particular, the subkeys, InstallPath , Modules , and PythonPath . 特别是,子项InstallPathModulesPythonPath

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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