WSGI Mania

I finally get it. I feel somewhat hip to WSGI.

A big thanks to Ben Bangert and his article WSGI and WSGI Middleware is Easy, which I like to call WSGI for Dummies ;-)

Anyhow, now that I “get it”, I have been messing with WSGI a bit.

WSGIAppFilter for CherryPy (targetting 2.2)
This handy filter allows you to mount a WSGI application in the CP object tree. A prerelease version is at my projects site. Some apps/frameworks I have tested running inside CP:

WSGI Middleware for CherryPy (and other stuff)
I have been working towards the goal of wrapping the CherryPy wsgiApp callable in middleware. I wrote a replacement server and then began trying to integrate my changes into the core. It hasn’t been a walk in the park, and the code isn’t in CherryPy yet, but it has been a good learning experience if nothing else. Robert Brewer has made me rethink my approach a few times, which is never a bad thing. Ian Bicking has provided good insight into WSGI in general.

Adding WSGI to Leonardo
I recently came across the excellent Leonardo project. It is a very nice Python CMS/Blog/Wiki type web app. When looking around for apps to test out my WSGI filter, I thought I would check and see if it had a WSGI implementation. Turns out it didn’t, but after a few hours I managed to wrap the necessary Leonardo functionality in a WSGI app callable and had it running under CherryPy with my WSGIAppFilter and under the wsgiref server. I shared the code with James Tauber, Leonardo’s creator, and he is going to test it out and possibly integrate it into the project.

All in all, I have been having fun with Python (as usual) and WSGI. There is also something brewing on the Python WEB-SIG regarding a PEPified templating API that builds on the TurboGears/Buffet templating plugin standard. We’ll see what comes of that.

cw

Leave a Reply