About
The Web Server Gateway Interface (WSGI) is a interface that specify how web servers should forward requests to web applications or frameworks.
It's written in the Python programming language.
Articles Related
Example
A basic “Hello World” application in WSGI without the help of a library such as Werkzeug looks like:
def application(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
return ['Hello World!']
where application is a WSGI application that you can call with the following arguments:
- environ is an environment dict containing all incoming information.
- start_response is a callable (a function) that can be used to indicate the start of the response.
Library
Documentation
- The current version of WSGI, version 1.0.1, is specified in Python Enhancement Proposal (PEP) 3333