mod_wsgi

Update: release candidate is available now.

The promise of WSGI is that Python web applications can be made more interchangeable. By implementing one simple interface, your application can be run with Django, TurboGears, or one of many other frameworks.

I'm developing Mush using wsgiref, a very basic WSGI server included in Python 2.5's standard library. For testing this is fine, but I need something something more full-featured for the live service. I tried a few options and then settled on deploying Mush with mod_wsgi.

Like mod_python, mod_wsgi embeds Python interpreters in Apache processes. The advantage over mod_python is that a WSGI application can be trivially configured. To serve my Mush application, mush.urls, all that is needed is one script:

# mush.wsgi

# import URL dispatching WSGI app
from mush import urls

# mod_wsgi looks for the name "application"
application = urls

and one new Apache directive:

WSGIScriptAlias /mush /path/to/scripts/mush.wsgi

Easy. According to the author, mod_wsgi is feature complete and a 1.0 release candidate is coming soon.