[mod_python] Not finding handler on public_html

Gregory (Grisha) Trubetskoy grisha at modpython.org
Wed Mar 6 14:13:57 EST 2002


mod_python prepends to sys.path the directory in which the PythonHandler
directive is specified. So if the PythonHandler is at the top level in
your config file, then you have to set the sys.path manually to make sure
Python can find your script. You can do this using the PythonPath
directive.

On Wed, 6 Mar 2002, Luis Sousa wrote:

> Hi everybody
>
> I installed mod_python on apache 1.3.23-1 and everything went OK.
> Reading the documentation I tried to test my server writing some simple
> tests. I created a directory in /var/www called test and I haved copeid
> to her the file mptest.py. I changed the configuration of apache
> introducing new lines to that directory, like in the example in 3.2,
> from the documentation.
> Everything went OK.
>
> Then I tried to do the same thing but in my home directory, in
> public_html. Here it gave some errors:
>
> Mod_python error: "PythonHandler mptest"
>
> Traceback (most recent call last):
>
>   File "/usr/lib/python2.1/site-packages/mod_python/apache.py", line 181, in Dispatch
>     module = import_module(module_name, _req)
>
>   File "/usr/lib/python2.1/site-packages/mod_python/apache.py", line 335, in import_module
>     f, p, d = imp.find_module(parts[i], path)
>
> ImportError: No module named mptest
>
> What could be the problem that I'm having ?
>
> Thanks in advance.
>
> Luis Sousa
>
>
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://www.modpython.org/mailman/listinfo/mod_python
>




More information about the Mod_python mailing list