[mod_python] Get the <Directory> config from handler

Graham Dumpleton graham.dumpleton at gmail.com
Wed Oct 3 18:58:19 EDT 2007

On 04/10/2007, Damjan Georgievski <gdamjan at gmail.com> wrote:
> I wan't to make a python auth handler, but that can only be used in
> apache <Directory> directives.
> Also I'd like to check from the handler what is the directory it's set
> up for... How do I do it?

If you are using mod_python 3.3.1 then you can access:


if it is not None, then used in Directory context. The value should be
the actual directory the handler directive occurred in.

Do note though that if handlers are registered dynamically, then
strictly speaking if req.hlist.directory is None then while
req.hlist.parent is not None, you should keep traversing back through
parent handler list record to see if req.hlist.directory is not None
is some parent context from which dynamic handler was registered.


More information about the Mod_python mailing list