Python Web - Web Server Gateway Interface (WSGI)


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.


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.



Powered by ComboStrap