[mod_python] testing mod_python on Ubuntu

Toby Donaldson tjd at sfu.ca
Tue Apr 8 22:06:28 EDT 2008


I've gotten stuck testing mod_python on Ubuntu (Gutsy) on what I
assume some simple oversight on my part. I'm using the standard
packages from apt-get:

mod_python 3.3.1
python 2.5.1
apache 2.2.4

Following http://modpython.org/live/current/doc-html/inst-testing.html,
I've added this to http.conf:

    <Directory /mptest>
        AddHandler mod_python .py
        PythonHandler mptest
        PythonDebug On

In the mptest directory, I have mptest.py with these contents:

from mod_python import apache

def handler(req):
      req.content_type = 'text/plain'
      return apache.OK

Yet every time I access mptest.py through the web, Firefox asks if I
want to view or save the file mptest.py. I've tried a number of
variations of this (re-starting Apache after each change), but it
always gives the same results.

I did get mod_python.testhanlder working.

Any advice on how to proceed?

Dr. Toby Donaldson
School of Computing Science
Simon Fraser University (Surrey)

More information about the Mod_python mailing list