[mod_python] How to make mod_python (Win32) not to rely on registry key?

Graham Dumpleton grahamd at dscpl.com.au
Sat Jun 24 02:39:06 EDT 2006


The SetEnv directive only affects environment variables inherited by
CGI scripts. It does not affect the environment of Apache itself and
thus does not affect the environment of mod_python. In order to add
extra directories into the Python module search path, use the
PythonPath directive as documented in the mod_python documentation.

Graham

On 23/06/2006, at 8:00 PM, sanja at bougakov.com wrote:

> Hello,
>
> I've installed mod_python/2.7.6 and Python/2.4.3 on Apache 1.3.36  
> (Windows).
>
> "Hello, World!" example works fine. My httpd.conf contains:
>
> ===cut here===
> SetEnv PYTHONHOME "c:/python24/"
> SetEnv PYTHONPATH
> "C:/Python24/Lib;C:/Python24/Lib/mod_python;C:/Python24/DLLs;C:/ 
> Python24/Lib/lib-tk"
> LoadModule python_module c:/python24/mod_python.dll
>
> <VirtualHost         127.0.0.1>
> ..skipped...
> <Directory "c:/Apache_Swissknife/Websites/localhost01/html/python/">
> AddHandler python-program .py
> PythonHandler test
> PythonDebug on
> </Directory>
> ===cut here===
>
> (note that environment variables are set using Apache's SetEnv  
> directives).
>
> The problem is that mod_python doesn't look at these env.  
> variables. It
> checks only HKCU\Software\Python registry hive. If I remove it and  
> restart
> Apache, I get "error 500".
>
> I am not happy of this behaviour because I need pocket version of  
> Apache
> and mod_python on my USB drive and do not want any modifications to  
> the
> Registry. Mod_perl works this way, why mod_python doesn't? Is there  
> any
> workaround?
>
> Yours,
> Sanja
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python



More information about the Mod_python mailing list