[mod_python] Not finding handler on public_html

Luis Sousa llsousa at ualg.pt
Thu Mar 7 09:45:03 EST 2002


I put this line in the directory definition of /home/llsousa/public_html 
and It's working:
    PythonPath "sys.path+['/home/llsousa/public_html']"

I tried to put in the directory definition /home/*/public_html a line 
like this and did not worked:
    PythonPath "sys.path+['/home/*/public_html']"
to all home public_html.

Is there a simple way to do this ?

Thanks, Luis Sousa


Gregory (Grisha) Trubetskoy wrote:

>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