[mod_python] Trying to get mod_python+apache on FreeBSD working.

Niranjan Perera pereran at yahoo.com
Fri Aug 18 07:57:16 EST 2000


I am  a newbie.

System: FreeBSD 4.0,
        Apache 1.3.12
        Python 1.5.2

Download mod_python, and followed instructions.

Added the following entry to httpd.conf

AddModule mod_python.c
<Directory /usr/local/www/data>
        AddHandler python-program .py
        PythonHandler test
        PythonDebug On

Placed in /usr/local/www/data the following code (
demo.py )
from mod_python import apache

def handler(req):
        req.write("Hello from Python!")
        return apache.OK

restarted httpd,

when I type http://xxx.yyy.zzz.com/demo.py
I get the following error message:

Mod_python error: "PythonHandler test"

Traceback (innermost last):

line 116, in Dispatch
    object = self.resolve_object(module, object_str)

line 51, in resolve_object
    raise AttributeError, s

AttributeError: module
'/usr/local/lib/python1.5/test/__init__.pyc' contains
no 'handler'

What am I missing ?


-- Niranjan

Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.

More information about the Mod_python mailing list