[mod_python] callable __auth__

Robert Thomas Davis rdavisunr at yahoo.com
Tue Feb 21 12:02:31 EST 2006


Hello everyone

...after spending a few hours with no success I
decided it was time to ask the experts...

First, my httpd.conf (the part relevant to mod_python)

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

<Directory /usr/local/matrix/http>
    SetHandler mod_python
    PythonHandler mod_python.publisher
    PythonDebug On
</Directory>

<Directory /usr/local/matrix/http/images>
    SetHandler default
</Directory>

<Directory /usr/local/matrix/http/css>
    SetHandler default
</Directory>

<Directory /usr/local/matrix/http/javascript>
    SetHandler default
</Directory>

<Directory /usr/local/matrix/http/data>
    SetHandler default
</Directory>

<Directory /usr/local/matrix/http/docs>
    SetHandler default
</Directory>


In the directory /usr/local/matrix I have a file
called "index.py"; in that file there are some
functions...

(shortened, but you get the idea)

def __auth__(req, user, pass):
        # this is 1 or 0 depending on status of
session
        return result

def index(req):

        return main(req)

def main(req):

        return stuff

def foo(req):

        return stuff


def bar(req):

        return stuff


Now for the problem...when I have things setup like
above the browser will popup the expected
user/password box.  HOWEVER; if I nest the def
__auth__(req, user, pass): inside of one of the other
functions I get no prompt for user/password!!

Ideas?

Thanks everyone!


More information about the Mod_python mailing list