[mod_python] Mapping a URI to pages dynamically.

David Fraser davidf at sjsoft.com
Tue May 20 09:30:22 EST 2003


ganapathy murali krishnan wrote:

> Sorry for not replying earlier... Here is the code, we use...
> I have removed pieces of the code which deal with other stuff.
> I hope I have not removed too many things...
> This code is due to Dustin Mitchell who setup our site
> initially.
>
> We use translate.py as our translate handler, which as you can
> see creates a req.url, which has lots of information about the
> requested url. The check_dont_handle function, allows us to not
> handle certain file types or certain subtrees of the DOCROOT.
>
> Hope you find the code useful.
>
> - Murali

I have found that we need to create physical directories in the Apache 
html directory corresponding to any subdirectories we want to handle in 
the Python script, otherwise we get a 404 error. Has anyone else found 
this? Is the SetLocation the answer for this?
The reason I would like to know is we would like to use dynamically 
generated path names without them existing on the disk

Thanks for the code
David



More information about the Mod_python mailing list