[mod_python] Apache/mod_python: Registering a request handler dynamically

Graham Dumpleton graham.dumpleton at gmail.com
Sun Dec 28 17:11:08 EST 2008


2008/12/29 Samuel Abels <newsgroups at debain.org>:
> On Mon, 2008-12-29 at 08:34 +1100, Graham Dumpleton wrote:
>> Are you saying you want one script to be able to work under either CGI
>> or mod_python?
>
> Yes, but that is only part of the problem. I am working with a software
> package that is supposed to be distributed to users who have little to
> no technical experience, and who may also have no access to change
> Apache directives. In other words, I am trying to make a package that
> runs under pretty much any server setup no matter what.
>
> In other words, using WSGI is a different problem that needs to be
> solved as well, but does not help if a server has no support for it.

If they can run CGI scripts already, then they can run a WSGI script.
They would not need to make changes to Apache configuration. That
example relies on having Python 2.5 for wsgiref, but you could instead
package your own simple CGI-WSGI bridge.

If they already have mod_wsgi available and Apache is configured to
run wsgi-script file type, or they can set AddHandler in .htaccess
file (same as CGI case), the same script will run fine with no
additional packages needing to be installed.

If they already have mod_python available and they can set AddHandler
in .htaccess file (same as CGI), you could supply your own
mod_python-WSGI bridge.

If they already have fastcgi/scgi/ajp available, they just need to
have flup installed, which supplies a WSGI bridge for those protocols.

So, WSGI can already be hosted on top of varying solutions. You seem
to suggest you want to ignore that and write your own bridges for all
the different hosting mechanisms out there, as well as come up with
your own private interface specification for talking to your
application.

So, all this stuff has been done, but if you want to re-invent a lot
of stuff, that is your call.

Graham


More information about the Mod_python mailing list