[mod_python] Mapping a URI to pages dynamically.

ganapathy murali krishnan gmurali at cs.uchicago.edu
Tue May 20 17:48:32 EST 2003


Philip Jägenstedt wrote:
 > Thank you for that information. Your code does much more than I need,
 > but it certainly did help me write a transhandler of my own. I have a
 > few questions which I hope you can answer for me:
 >
 > A: Does the code have a licensed attached to it, if I decide to use any
 > of it at a later date? (GPL, public domain... ?)
 >

That was a no strings attached code.
Dustin: You have anything you want to add?

 > B: As it is now (just did this 5 minutes ago) I have the following in 
--snip --
 > URI begins with the /stdb. Can I add something to httpd.conf to make
 > PythonTransHandler apply only to /stdb, or am I then trapped in already
 > being past the Trans phase?

In the code you see, there is a check_dont_handle function, which
looks at the specified URI and decides if it should handle. Our handler
decides to handle it, based on the extension of the file requested. In
another web server, we also decline to handle if the requested URI lies
in some specific subtrees of the DOCROOT. If your handler declines to
handle it, then the default apache handler will take over. So all you 
need to do is to check if the requested URI is in the stdb subtree, else
decline to handle it, and the normal Apache Handler should kick in.

- Murali



More information about the Mod_python mailing list