Python Web Server Gateway Interface (WSGI)

A web application consists of code that responds to HTTP requests to return an HTTP response. A web application is not the same as a web server; the server is listening on the network socket for requests and decoding them and then sending back the response. The web application is the code that takes the request information and generates the response. To write a web application we need a way to send the request information from the server to the application code; there are many ways to do this for different combinations of web server and application environment.

In Python, the low-level interface to web applications is called WSGI (Web Server Gateway Interface). It defines a standard way of defining a procedure to act as as web application.

While it is possible to write an application using the low-level WSGI standard, it is usually much more convenient to use a higher level abstraction in the form of a framework. This means that we use a python module that does some of the work for us and takes away some of the complexity of dealing with the low level WSGI standard.

There are many frameworks to choose from for Python (see this list).

Web Application Frameworks


A Web framework is a collection of packages or modules which allow developers to write Web applications (see WebApplications) or services without having to handle such low-level details as protocols, sockets or process/thread management.