== About WSGI ==

modu is based around Python's WSGI protocol. WSGI was created ostensibly to provide a familiar but standardized way to create Python web applications. Although it is widely used, it is not without its flaws, in specification and often in implementation of the frameworks that implement it. Some of these issues are outlined at the following URLs:

    * http://www.b-list.org/weblog/2009/aug/10/wsgi
    * http://lucumr.pocoo.org/2009/7/30/nih-in-the-wsgi-world
    * http://lucumr.pocoo.org/2009/8/5/pro-cons-about-werkzeug-webob-and-django

However, it does provide a generally well-documented interface for dealing with web applications, and is generally well accepted by the community.

There are a few caveats that should be understood when dealing with modu, and its particular implementation of WSGI. During the development of the modu codebase, great care was taken to follow the spec, but there are still likely some derivations and issues. The reality of implementing WSGI properly is that there are a number of small differences between different apps and host environments that must be accounted for.
    
    * The `Request` object that is passed around a modu web app is a subclass of the Python `dict` object, which provides additional functionality, but does not interfere with the usual WSGI environment variables. Therefore it is possible to run other WSGI applications through a shim `Resource` in modu, which then passes the same `Request` object as the `environ` to the WSGI application object.
    
    * modu has been tested (and is used extensively in production) with the mod_wsgi plugin for Apache 2.2 and later. So far it has only been used with the prefork MPM, but it should support the threaded (worker) MPM as well.
    
    * The current built-in webserver is based on Twisted Web, using Twisted Web WSGI support. The `modu-web` '''twistd''' service implements the WSGI environment with additional features helpful when debugging modu applications.
