[mod_python] Serving files via mod_python

Hugo van der Merwe s13361562 at bach.sun.ac.za
Thu May 23 22:34:33 EST 2002

> > Build a TransHandler which checks permissions and whatnot, then either (a)
> > calls add_handler with a pythonhandler which will display an error message,
> > menu, etc. or (b) produces the filename of the file that Apache should send
> > along.
> Sorry about asking about this here again, I had a good and wide search
> to find info, but I'm too pressed for time now, and so far searches
> haven't helped me on this last issue:
> I've got TransHandler working nicely, at least, until I don't want it to
> do it's thing: how do I get the "default behaviour", once TransHandler
> determines that it's not a URL that it should handle? I want it to then
> go via the "usual, standard" routes... simply not touching req.filename
> leaves it as "/", I guess I could just prepend /var/www to the
> unparsed_uri, will apache then do it's alias thing, etc? It still
> doesn't seem like the neatest solution though.

Replying to myself ... but I found a little more info, and I want to
send this to the list as well.

I found the following:

apache.DECLINED, meaning this handler refused to handle this phase of
the requestand Apache needs to look for another handler. 

Returning this seems to "work" in some sense, I get the following 404

Not Found The requested URL /show.py/norm was not found on this server.

If I do not have the PythonTransHandler, my "normal" PythonHandler takes
care of this...

Hugo van der Merwe

More information about the Mod_python mailing list