[mod_python] Mapping a URI to pages dynamically.

David Fraser davidf at sjsoft.com
Mon May 19 16:06:51 EST 2003

Mike Looijmans wrote:

>I chose option #4: Build your own.
>I just have /xx scriptaliased to point to a single .py handler. That one takes
>the uri (request.path_info) and uses that to make the proper call.
Very cool. Is this with Apache directives?

>I made it so that the request is like:
>(session could be a session ID, or name of database to use, and such).
>The figures out which module to (re)import (the one named "script" in this
>case), loads it, firgures out the parameters (usually the request object,
>authorization information and a database connection) and calls its "main"
Presume you mean "The handler figures out"...?

>Took about an hour to invent, implement and test and has been working
>flawlessly for months. I like this language :-)
>And it's backwards compatible with CGI too, at least, to the extent that I
>need, so that servers without mod_python can use the same codebase (only the
>initial handler differs).
Very nice...
I think a description of how to do this would be a great addition to the 
modpython manual...


More information about the Mod_python mailing list