Short introduction to WSGI interface implemented by well-known libraries like Flask and Django.

WSGI is the Web Server Gateway Interface. It is a specification that describes how a web server communicates with web applications, and how web applications can be chained together to process one request. WSGI is a Python standard described in detail in PEP 3333.

What is WSGI

In a single sentence, WSGI is just an interface specification by which the server and application communicate. This interface used by many popular frameworks like Flask and Django is defined in the PEP 3333 specification for both parties: server and WSGI application.

Python 2.5 and later comes with a WSGI server which will be used in this tutorial. In 2.4 and earlier it can be installed.

WSGI Frameworks

A short-list with web frameworks with native WSGI support:

  • Flask - Flask is a microframework for Python based on Werkzeug, Jinja 2 and good intentions

  • Django - The web framework for perfectionists with deadlines.

  • Pyramid - Pyramid is a minimalist web framework aiming at composability and making developers paying only for what they use.

  • Falcon - Falcon is a high-performance Python framework for building cloud APIs

WSGI Resources