[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


Hello:

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
</Directory>

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

def handler(req):
        req.send_http_header()
        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):

  File
"/usr/local/lib/python1.5/site-packages/mod_python/apache.py",
line 116, in Dispatch
    object = self.resolve_object(module, object_str)

  File
"/usr/local/lib/python1.5/site-packages/mod_python/apache.py",
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 ?


Thanks,

-- Niranjan






__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/



More information about the Mod_python mailing list