The up-and-coming mod_wsgi
It seems that mod_wsgi is the new thing in Python web hosting. Okay, it’s not quite as feature-laden as the more established mod_python, but it sure is good. It does one thing, and it does it well: hosts Python apps under Apache and provides a WSGI interface.
We switched to mod_wsgi (and recommend it to others) because of its …
Simplicity. mod_wsgi is extremely simple to set up and configure:
make install
,a2enmod wsgi
, and then one line in your Apache config. Plus (for hackers), it’s written as a single C file, so you can get your head around the whole thing.Daemon mode. It was no fault of mod_python’s, but we spent a few days tracking down a rather subtle bug in the psycopg2 database adapter. Apart from hacking psycopg2, the only way to fix it was to use mod_wsgi’s daemon mode, which runs your app in a separate process.
Documentation and documentor. mod_wsgi is written by Graham Dumpleton, and he’s very much alive maintaining and documenting it. He found the psycopg2 bug, and his input on the mod_wsgi and mod_python lists is very helpful. Cheers, Graham.
We’re using mod_wsgi with web.py, but it also works with Django and many other frameworks. Even better (at least for people running XP like me), it’s ready-to-go under Windows.
As for stability, mod_wsgi is “only” version 1.0, but microPledge has been running live on it for over a month now — with no glitches.
Basically, if you want a simple and fast way to host your Python web app, mod_wsgi is great way to go.
Oh, and we can’t help but show you our cool dynamic widget (you can easily use these for your own microPledge projects). Graham’s humble enough not to care much about soliciting money, but we can still point you to his donations box. :-)
If you’ve enjoyed mod_wsgi or Graham’s helpful responses, consider giving mod_wsgi a bit of what Ohloh thinks it’s worth by clicking the widget.
6 September 2007 by Ben add a comment