I had an urge to revisit django this morning after introducing a co-worker to it sometime back and watching him get excited about python and web development. This particular coworker has become a bit smitten with web2y lately himself, after starting down the django track. But what do these two frameworks have in common? While besides being python based - they are both WSGI compliant.
Originally when I first dove into django to do some mickey mouse web development, I sheepishly followed the tutorials and used apache2+mod_python - which is what django suggests by default and used originally before complying with WSGI (if I have my history correct). That may be the more scalable choice, but I can't say for certain since I haven't dug into the details regarding what API to use between framework and web server.
But I think using WSGI is cool - and here's why. First of all, it's becoming (or is already) an established standard. PEP 333 is the official documentation and community proposal for WSGI if more info is needed, though I found this short paper to be quite a decent and quick overview. Nearly all python web frameworks are adhering to it, including the aforementioned web2py and django. So basically what this means is that regardless of what web server I'm forced to use, we should always have our choice of web frameworks to use with that web server. Conversely, if I've written (or need to support) a python web application written using a particular framework that supports WSGI, I'll be able to deploy my web application in any web server that supports WSGI. WSGI has allowed, potentially, the same application I've written targetted to an apache environment to be used over on GAE (although obviously I'd need to adapt or rewrite the data access layer to take advantage of BigTable).
So with that said, I welcome WSGI and now think it is a *good* thing.
New Location
My website has moved to http://www.jasonwhaley.com. Please visit there for the latest and only remain here for legacy content.
Wednesday, July 30, 2008
Subscribe to:
Post Comments (Atom)
1 comments:
Hi Jason, thank you for your post and please send my respects to your co-worker. I would like to make two comments: The first is that web2py was based on WSGI since its first release in October 2007, Django is being ported to WSGI (although it currenlty provides a handler for it) and this is part of their 1.0 roadmap. The second is that GAE is actually based on CGI but provides WSGI via a handler. WSGI in itself is not sufficient to make a framework work under GAE. In the case of web2py the entire framework, including the database abstraction layer works on GAE (and this took a lot of work of many people), in the case of Django, the ORM does not.
Post a Comment