[mod_python] how do I eliminate the .py extension in url?

Rob Nichols rob at robnet.com
Thu Feb 10 23:07:30 EST 2005


On Thu, Feb 10, 2005 at 06:30:32PM -0600, Shawn Harrison wrote:
> Put the following in httpd.conf:
> 
> SetHandler mod_python
> PythonHandler module.path.to.handler.file
> 
> Then in the handler file, def a handler that looks for python scripts
> and loads them based on the req.uri. The attached very crufty handler
> might be a good source of amusement.

Are you using this in a production environment?  If so, can you give a rough
estimate of the cost of "a little python and usually req.sendfile()" compared
to apache serving up text files?  

I'm quite new to mod_python, just toying with it for some pet projects.  It
seems really cool, but I don't have a feel for the performance yet.  I'll do
some tests "some day" (before I do anything serious), but curious about what
others have found.  

TIA,
Rob


More information about the Mod_python mailing list