httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Howell <>
Subject [users@httpd] Testing Mod_python.
Date Fri, 31 Aug 2007 14:33:25 GMT
Hi All,
FYI, I also posted this to you the Mod_python mailing list, but I am 
hoping someone here might have a solution seeing this before as well. *

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: ** 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/'
Location:       None
Directory:      'C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/Test/'
Filename:       'C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/Test/'
PathInfo:       ''

Phase:          'PythonHandler'
Handler:        'mptest'

Traceback (most recent call last):

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

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

  File "C:\Python25\Lib\site-packages\mod_python\", 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

View raw message