[mod_python] Directory containing PythonHandler directive.

Graham Dumpleton grahamd at dscpl.com.au
Fri Sep 10 02:33:34 EDT 2004


One can define PythonHandler within httpd.conf or .htaccess. In both cases, it is
connected to a particular directory within the filesystem and all requests falling
under that directory will go to that handler.

Is there any way that one can find out within a content handler at what directory
level the PythonHandler directive appeared for the request being processed?

Ie., if PythonHandler is defined in:

  /a/b/.htaccess

and the request is for:

  /a/b/c/d/e.html

I want to be able to determine in content handler being used to service the request
that PythonHandler was defined at root directory level of:

  /a/b

Note that within the content handler system I am using, path_info doesn't give you
this information, as there actually is a file present at the path being requested and
so it is not separated out from the filename.

I am wanting to know this, as I want to be able to implement a configuration file
system, where a search is made for an appropriate config file by searching back up
the directory structure, but stopping at the point where the PythonHandler
directive was defined.

I haven't looked at the actual code yet to see if there is a way and I may have missed
something obvious in my simple tests. I am using mod_python version 2.7.10 so
would rather not a mod_python 3.X specific solution.

Thanks in advance.

--
Graham Dumpleton (grahamd at dscpl.com.au)


More information about the Mod_python mailing list