[mod_python] PythonPath problem

Shuying Wang shuying at gmail.com
Tue Mar 29 20:49:22 EST 2005


Hi,

I'm new to mod_python and I have a whole bunch of legacy code to get
running with mod_python. I've followed the manual for configuration
and I'm getting a blank page. I read mod_python FAQ #2.4 but I still
can't figure out what I'm doing wrong.

I've added the following  to my apache config file:
LoadModule python_module /usr/lib/httpd/mod_python.so
AddHandler mod_python .py 
PythonPath "sys.path + ['$python_lib', '$docroot']"
PythonHandler mod_python.cgihandler  
PythonOptimize On
DirectoryIndex index.py
PythonDebug On

$python_lib and $docroot are 2 sub-directories in the current
directory and files in $docroot requires packages in $python_lib to
work.  If I do not use the PythonPath directive, I  get "ImportError:
No module named x" where x is a module in $python_lib. I'm using
apache2 (httpd-2.0.46-44.ent) with mod_python3.0.3
(mod_python-3.0.3-5.ent) on rhel-3.

Thanks for any help in advanced.

--Shuying


More information about the Mod_python mailing list