[mod_python] Serving files via mod_python

Johannes Erdfelt johannes at erdfelt.com
Tue May 21 19:12:44 EST 2002


On Tue, May 21, 2002, Ian Clelland <ian at veryfresh.com> wrote:
> > how can I do this while controlling it all from
> > modPython? I guess I could just define a PythonAuthenHandler, and let
> > Apache do the actual serving? Does the PythonAuthenHandler have full
> > access to just about everything a normal handler would? (URL, etc.)
> 
> That's a good way to do it, assuming that the files are already on the 
> filesystem, and not being stored in a database or ripped in realtime. 
> What you are looking for, though, is a PythonAuthzHandler 
> (authorization handler). This is the handler which gets called *after* 
> the user's name and password have been verified, (by a .htpasswd file 
> or some other method,) and decides whether that user is allowed to 
> download that file.
> 
> > If there was some way to give Apache a file handle or something like
> > that, from which it should serve the data...
> 
> You don't even need to do that; all you have to do is install the 
> PythonAuthzHandler, and let Apache handle serving the actual content. 
> The AuthzHandler will act like a 'filter' on an otherwise normal 
> request/response.

Is this new? It's not in the documentation:

http://www.modpython.org/live/mod_python-2.7.8/doc-html/dir-handlers.html

JE




More information about the Mod_python mailing list