[mod_python] WSGI gateway for mod_python

Graham Dumpleton grahamd at dscpl.com.au
Fri Feb 10 18:25:40 EST 2006

On 09/02/2006, at 8:51 PM, Robert Brewer wrote:

> Hi everyone,
> I've reworked my modpython_gateway module, removing the dependency  
> on wsgiref. If you'd like to include it in the standard MP distro,  
> I'd be willing to release it under any free terms: public domain,  
> MIT, other. Let me know what your licensing requirements are.
> http://projects.amor.org/misc/wiki/ModPythonGateway
FWIW, a few comments.

1. The global "_counter" variable used by the profile() function is  
not used in
a thread safe way, so could screw up on multithreaded MPM.

2. The whole "import" Python option thing is not required as there  
are other
better ways of doing that with mod_python. For example:

   <Location /myapp>
     SetHandler python-program

     PythonFixupHandler myapp.cherrypy::startapp
     PythonHandler modpython_gateway::handler

     PythonOption application cherrypy._cpwsgi::wsgiApp

In other words, instead of using your "import" PythonOption, use the  
PythonFixupHandler to trigger the execution of the "startapp"  
function for each

That's all for now.


More information about the Mod_python mailing list