Python Web - Web Server Gateway Interface (WSGI)

> Procedural Languages > Python > Python - Web

1 - 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.

Advertising

3 - 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.

4 - Library

5 - Documentation

lang/python/web/wsgi.txt · Last modified: 2019/04/26 17:45 by 141.101.98.8