[mod_python] mod_python.publisher weirdness

Jeff Hinrichs jlh at cox.net
Wed Apr 14 21:37:40 EST 2004

----- Original Message ----- 
From: "Gregory (Grisha) Trubetskoy" <grisha at modpython.org>
To: "Jeff Hinrichs" <jlh at cox.net>
Cc: <mod_python at modpython.org>
Sent: Wednesday, April 14, 2004 8:58 PM
Subject: Re: [mod_python] mod_python.publisher weirdness

> On Wed, 14 Apr 2004, Jeff Hinrichs wrote:
> > Also, If I wanted to hide the .py extensions and I don't want to use the
> > PythonInterPerDirectory, I would most likely need to implement some
> > rewrite rules to do something like
> > /foo -> /foo/foo.py
> > /foo/bar -> foo/bar/bar.py
> The simplest way to hide the .py is to use SetHandler rather than
> AddHandler in the apache config.
> Grisha
But, from what I'm reading on the web, by using SetHandler, all requests,
even for an image in /foo/images/pic.jpg would then be sent to the
mod_python, correct?  What, I think I am after is something that would allow
a structure like (with PythonInterPerDirectory On):

/foo                                   (is a mod_python directory )
/foo/logon                          (handle a logons request, module foo/def
/foo/images                        (serves up .jpg/.png/etc found inside)
/foo/modules                      (below are site add-ons, i.e. msgboard or
db browser)

/foo/modules/mboard              (a mod_python directory with it's own
/foo/modules/mboard/images   (serves up .jpg/.png/etc found inside)

/foo/modules/dbbrowser          (a mod_python directory with it's own
/foo/modules/dbbrowser/images    (serves up .jpg/.png/etc found inside)

Where the modules depend on services provided by /foo for authentication and
access control via some sort of api.  So as a company requests a new
weblication  I can just wire it in to the modules subdirectory using the
authentication and access supplied by foo.

In a nutshell, how best to: If the module/method is not found, the named
physical directory is searched before a 404 or error is returned, while
hiding the .py extension.  OR am I really going about this bass-ackwards
with respect to mod_python?  I've got python experience but I'm new to
mod_python, so if you feel you need to use the clue stick, please swing

p.s. I've been reading your pycon notes and having been kicking myself for
not being there :(

More information about the Mod_python mailing list