The WSGI standard

The Web Server Gateway Interface (WSGI) defines a relatively simple, standardized design pattern for creating a response to a web request. This is a common framework for most Python-based web servers. A great deal of information is present at the following link: http://wsgi.readthedocs.org/en/latest/.

Some important background of WSGI can be found at https://www.python.org/dev/peps/pep-0333.

The Python library's wsgiref package includes a reference implementation of WSGI. Each WSGI application has the same interface, as shown here:

def some_app(environ, start_response):
    return content  

The environ parameter is a dictionary that contains all of the arguments of the request in a single, uniform structure. The headers, the ...

Get Functional Python Programming - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.