[mod_python] Access-Handler based on a Variable

Christian Klinger cklinger at novareto.de
Mon Aug 6 04:42:03 EDT 2007

Hi mod_python Users,

i am new to mod_python so sorry for stupid questions.

I try to write an access handler for an xml-rpc connection.
The access handler should check if a key in the xml-rpc
data is correct.

Here my questions:
Is this possible with mod_python?
Has anyone an example?
How can i access the (12) of getResults in the accesshandler.


Here is my code:
<VirtualHost *:80>
     ServerName dummy-host.example.com
     ServerAlias www.dummy-host.example.com

    <Proxy *>
       AuthBasicAuthoritative Off
        AddHandler mod_python .py
        PythonHandler myscript.py
        PythonAccessHandler myscript
        PythonDebug On
        PythonEnablePdb On

         RewriteEngine On
         RewriteRule ^/(.*) 


def accesshandler(req):
     apache.log_error("accesshandler -%s" %req)
     if key == "OK"
         return apache.OK

the client:
portal = xmlrpclib.Server('')
print portal
print portal.getResult(12)

More information about the Mod_python mailing list