[mod_python] <Location> vs <Directory> ?

mike at mikebell.org mike at mikebell.org
Sun Dec 2 11:30:10 EST 2001


On Sun, Dec 02, 2001 at 09:08:22AM -0500, Bob Ippolito wrote:
> It seems to be possible to use <Location /some/url> instead of <Directory
> /some/path> with mod_python.
> 
> It can be desirable at times to be able to use a PythonHandler at any
> arbitrary URL, not just directories or files with the .py extension.  I
> didn't see this documented anywhere, or talked about on the list (at a
> glance of subjects for the past couple months).  This way you can make a
> python script look like a single file.. i.e.
> 
> <Location /some/url/somefile.html>
>   SetHandler python-program
>   PythonHandler myHandler
> </Location>
> 
> this won't affect other .html files at /some/url.

Yes, I've been doing this since I first started using mod_python for things
like <Location /camera>. If you find some neat trick like that which you
think others might be interested in, why not make it a new entry in the FAQ?
Then it'll be there for people in the future without them having to read
through the mailing list archives.



More information about the Mod_python mailing list