mod_python config problem

Manuel Pellecer mpellecer at
Fri Jun 3 21:16:17 CEST 2005

i want to use mod_python with Apache2 and i made a .htaccess in the 
subdirectory where i have all my scripts:

The .htacces goes like this:

AddHandler mod_python .py

PythonHandler mptest

PythonDebug On

and I changed the main configuracion file of Apache2 like this:


<Directory /var/www/cgi>

        AllowOverride FileInfo



and i made a that goes like this:

from mod_python import apache

def handler(req):

        req.content_type = "text/plain"

        req.write("Hello World!")

        return apache.OK

But i still have this error and i don't know why

Mod_python error: "PythonHandler mptest"

Traceback (most recent call last):

File "/usr/lib/python2.4/site-packages/mod_python/", line 287, 
in HandlerDispatch

File "/usr/lib/python2.4/site-packages/mod_python/", line 454, 
in import_module
f, p, d = imp.find_module(parts[i], path)

ImportError: No module named mptest

Please some help!!!

More information about the Python-list mailing list