[mod_python] python handler

gOLeM aditya.vrr at gmail.com
Mon May 8 01:42:19 EDT 2006


from mod_python import apache

def handler(req, arg = "1"):
    req.content_type = 'text/html'
    myfile = open("/var/www/html/ajax/index.html", "r");
    for line in myfile.readlines() :
        req.write(line)
    return apache.OK

this is myhandler.py


<Directory "/var/www/html/xxxxxxxxx">
        AddHandler mod_python .py
        PythonHandler myhandler
        PythonDebug On
</Directory>

when i try http://localhost/myhandler.py?arg=2
it is not taking the value of arg as 2. Is it the expected behaviour
or am i doing something wrong?

--
The Purpose of Life is a life of purpose -- Leider, Richard
Quitters never win and Winners never quit   -- Napolean Hill



More information about the Mod_python mailing list