[mod_python] How to control Python path?

Graham Dumpleton graham.dumpleton at gmail.com
Wed Oct 10 18:15:14 EDT 2007


This is nothing to do with PythonPath, your mod_python installation
simply isn't working. Read same comments against message just given to
someone else for Win32 problems:

  http://www.modpython.org/pipermail/mod_python/2007-August/024176.html

In short Python can't initialise itself as it can't find its own
Python library directory or the files in it aren't readable to user
that Apache is running as.

Graham

On 10/10/2007, Slava <slava at acdlabs.ru> wrote:
> Hello All,
>
> I spent some hours but still unable to control subj
> I added the below to httpd.conf
>
> <Location "/mysite/">
>   SetHandler python-program
>   PythonHandler django.core.handlers.modpython
>   SetEnv DJANGO_SETTINGS_MODULE settings.py
>   PythonPath "[r'C:\\md\\htdocs\\django\\django\\bin\\mysite'] + sys.path"
>   PythonDebug On
> </Location>
>
> But for some reason PythonPath directive is ignored by Apache.
> Contents of errors log after Apache restart:
>
>
> [Wed Oct 10 16:04:23 2007] [error] make_obcallback: could not import mod_python.apache.\n
>
> [Wed Oct 10 16:04:23 2007] [error] make_obcallback: Python path being
> used "['C:\\\\soft\\\\Python\\\\python25.zip', '.\\\\DLLs',
> '.\\\\lib', '.\\\\lib\\\\plat win', '.\\\\lib\\\\lib-tk',
> 'C:\\\\soft\\\\comm\\\\Apache2_2_3\\\\bin']".
>
> My httpd.conf file is not ignored by Apache. I tried to replace
> "PythonPath" with "PythonPath777" - in this case Apache refused to
> restart.
>
> Also, I tried to carry out PythonPath directive to the outside of
> <Location> tag. It won't helped.
>
> I'm still unable to modify Python path so I'm little confused. Can you
> pls help? =)
>
> Also, is there other way to control Python path?
>
> Thanks
>
> --
> Best regards,
>  Slava                          mailto:slava at acdlabs.ru
>
> _______________________________________________
> 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