[mod_python] Mapping a URI to pages dynamically.

David Fraser davidf at sjsoft.com
Tue May 20 14:12:39 EST 2003


Dustin Mitchell wrote:

>On Tue, May 20, 2003 at 09:30:22AM +0200, David Fraser wrote:
>  
>
>>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
>>    
>>
>
>For some unknown reason Apache checks that req.filename exists.  I usually
>just point it at the translation script itself (__file__).
>
>Dustin
>
>  
>
Thanks, where does the check happen, and where do you do the pointing?
Looking at the docs, I guess it could happen in PythonTransHandler, 
PythonHeaderParserHandler or PythonInitHandler
It doesn't seem clear to me exactly where the path resolution is done in 
Apache relative to these handlers... Looking at the mod_python source 
didn't seem to indicate either
PythonTransHandler is designed to resolve the URI to a filename, but the 
resolution is actually correct, so it would be nice not to interfere 
before the actual .htaccess file is used...

Thanks again
David



More information about the Mod_python mailing list