This post originated from an RSS feed registered with Python Buzz
by Titus Brown.
Original Post: 26 Nov 2004
Feed Title: Advogato diary for titus
Feed URL: http://advogato.org/person/titus/rss.xml
Feed Description: Advogato diary for titus
QOTDE: Things Will Change -- Iain M. Banks, Against a Dark
Background (the quote on Gorko's Tomb)
WSGI, Quixote, SCGI, QWIP, and SWAP
In a fit of depression over lousy experimental results, with a healthy
serving of turkey on top, I decided to turn my hand to something I do
better than experimental molecular biology: program in Python. (Trust
me, whatever you think of my programming... my molecular biology is
weaker. sigh.)
QWIP, the "Quixote-WSGI interface p(something)", wraps the
Quixote publisher
in a WSGI-compliant application object. This lets any WSGI-compliant
servers out there (are there any?) publish Quixote objects.
SWAP, the "SCGI-WSGI application p(something)", allows the
SCGI
standalone server interface ('scgi server') to run WSGI-compliant
applications. For example, this lets mod_scgi run WSGI applications via
the SCGI server -- including QWIP-wrapped applications, which was my
testing strategy ;).
Overall, my modicum of experience with the internals of Web servers
(mostly from PyWX and some
minor hacking on Quixote) served me
well; it took me about 1 hr to get QWIP working, and about 3 hours
to get SWAP working. (Over half of those three hours was spent
figuring out that (1) I was instantiating a new object rather than
calling the superconstructor, because I'd left out __init__; and
(2) that SCGI expected the input and output streams to be closed
to signal that the connection was over. Sigh.) It was pretty satisfying
to sit back and set up this set of modules:
I'm now moderately more optimistic about the usefulness of WSGI. I
hate (no, loathe) frameworks
that attempt to solve the problems of mankind, if you'll just drink
this cool-aid sir... But, notwithstanding the philosophical debut in
the WSGI PEP,
it was pleasant to implement the adapters and I could see WSGI being of
significant benefit to Web server authors. Or maybe by buying into
the framework I've sold out and you can't trust my opinion ;).
So, kudos to Phillip Eby & I hope this stuff is useful to someone! Now,
back to making my Quixote applications do more stuff!
--titus
p.s. Has anyone else noticed that advogato.com and www.advogato.com read cookies differently? Kind of amusing to go to one or the other and have different options available, one as logged-in member & the other as nobody...