Implementing a REST server – WSGI and mod_wsgi
As REST is built on HTTP, a REST sever is an extension to an HTTP server. For robust, high-performance, secure operations, common practice is to build on a server such as Apache httpd or the nginx. These servers don't support Python by default; they require an extension module to interface with a Python application.
One widely used interface between web servers and Python is the WSGI. For more information, see http://www.wsgi.org. The Python Standard Library includes a WSGI reference implementation. See PEP 3333, http://www.python.org/dev/peps/pep-3333/, for the ways this reference implementation works in Python 3.
The idea behind WSGI is to standardize the HTTP request-reply processing around a relatively simple and extensible Python API. This allows us to architect complex Python solutions out of relatively independent components. The goal is to create a nested series of applications that perform incremental processing on the request. This creates...