WSGI
From Docunext Technology Wiki
Contents |
Summary
As I understand it, WSGI is an API designed to make web services created in Python more consistent. This is a great idea. After exploring WSGI for just a couple of days, I've found it to very refreshing and exciting concept. If I understand it correctly, it has the potential to really connect web applications and processes in a fairly simple yes powerful way.
Environ
Environ is the dict which contains all the stuff you may want to access from the server environment.
pathInfo = environ["PATH_INFO"]
This is tricky becasue with mod_wsgi I'm not getting any result for PATH_INFO. I do get a value for QUERY_STRING and SERVER_NAME though.
WSGI Modules
I've been perusing a set of WSGI modules from wsgi.org (link at the bottom), and I really like what I see. Part of what I love about open source is the collaboration and arguments that go on between factions. Every once in awhile, the group gets smart and decides it would be better to work together in their own different ways. Even if 90% of what we do is different, by agreeing to the 10% that overlaps, we'll all be better off. That's sort of the attitude I've taken with PBooks. Everyone does their books differently, but everyone shares a small portion of their methodology with extreme likeness.
But back to the WSGI Modules... there are a lot of good ones. I see a couple of exception handlers, url-to-wsgiapp routers/maps (Python WSGI Selector), authentication, sessions, content filters (Python WSGI webstring), even data source handlers. Unfortunately I'm having a hard time figuring out how to use them. There are a bunch of differences between PHP and Python and I guess that's making it hard for me to understand how this stuff works.
There are a bunch of WSGI web server modules too, which is confusing to me. I can't figure out if I like the idea of a python web server or not, mostly because I'm such a huge fan of Apache. It was nice to be able to start up a web server on port 8000+ to try out a "Hello world" WSGI app, but now I've been using mod_wsgi, I'm happy with that.
Its great that WSGI modules are proliferating, and that many of them are small and focused. Sound familiar? From my perspective, it fits in well with the UNIX philosophy - "do one thing and do it well".
WSGI Middleware
I really like the idea of chaining multiple WSGI applications together, so I'm going to give it a try: Chaining Multiple WSGI Applications Together.
Middleware Examples
Related Pages
External Links
- http://wsgi.org/wsgi/Middleware_and_Utilities
- http://trac.saddi.com/flup
- http://decafbad.com/blog/2005/07/18/discovering-wsgi-and-xslt-as-middleware
- http://darcs.idyll.org/~t/projects/scotch/doc/
- http://linuxgazette.net/115/orr.html
- http://www.pythonweb.org/projects/webmodules/
- http://wiki.codemongers.com/NginxNgxWSGIModule
- http://docs.python.org/lib/module-wsgiref.handlers.html
- http://werkzeug.pocoo.org/documentation/wsgihowto
- http://farmdev.com/thoughts/35/wsgi-intercept-has-a-new-home/