[mod_python] Testing Mod_python

Chris Howell chowell at pyxisinnovation.com
Fri Aug 31 10:25:13 EDT 2007

Hi All.

So I got  mod_python installed, with apache on my windows box running 
WinXP SP2. When I went to test the mod_install following the directions 
on this site.


I put the directory in this my httpd.conf file, and it looks like this.

<Directory "C:/Program Files/Apache Software 
  Options FollowSymLinks
  AllowOverride All
  Order deny,allow
  Satisfy all
  AddHandler mod_python .py
  PythonHandler mptest
  PythonDebug On

I restarted the Apache server no problem.

My python test file looks like.

from mod_python import apache

def handler(req):
    req.content_type = 'text/plain'
    req.write("Hello World")
    return apache.OK
File name: *mptest.py* and it's in the appropriate directory and 

When I try to point by browser URL at the python file with this.


I get this error message.


ProcessId:      1652
Interpreter:    'euclid.PyxisInnovation.local'

ServerName:     'euclid.PyxisInnovation.local'
DocumentRoot:   'C:/Program Files/Apache Software Foundation/Apache2.2/htdocs'

URI:            '/Test/mptest.py'
Location:       None
Directory:      'C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/Test/'
Filename:       'C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/Test/mptest.py'
PathInfo:       ''

Phase:          'PythonHandler'
Handler:        'mptest'

Traceback (most recent call last):

  File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1202, in _process_target
    module = import_module(module_name, path=path)

  File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 304, in import_module
    return __import__(module_name, {}, {}, ['*'])

ImportError: No module named mptest

Any help would be great.

Chris Howell
Software Engineer
the PYXIS innovation - /Common Ground for Digital Earth/
Kingston Ontario
w: www.pyxisinnovation.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20070831/b804ff1c/attachment.html

More information about the Mod_python mailing list