WSGI [1] is not a server, a python module, a framework, an API or any kind of software. It is simply an interface specification that defines how a server and application communicate. Both server and application sides are specified in PEP 3333. If an application (or framework or toolkit) is written to the WSGI specification, it will run on any server written to that specification.
WSGI applications (meaning WSGI-compliant applications) can be stacked. Those in the middle of the stack are called middleware and must implement both sides of the WSGI interface: application and server. For the application on top of it, it behaves as a server, and for the application (or server) bellow it, it behaves as an application.
A WSGI server (meaning WSGI compliant) only receives the request from the client, passes it to the application, and then sends the response returned by the application back to the client. It does nothing else. All the gory details must be supplied by the application or middleware.
It is not necessary to learn the WSGI spec to build applications on top of frameworks or toolkits. Howerver, to use middleware, one must have a basic understanding of how to stack it with the application or framework, unless it is already integrated into the framework or the framework provides some kind of wrapper to integrate components that are not.
Python comes with wsgiref.simple_server, which will be used in this tutorial. For production code, use an industry-proven standard such as Apache with mod_wsgi.
All the code in this tutorial is low-level and serves the sole purpose of demonstrating the WSGI specification in action. It is not intended for real-world use. For production code, stick to toolkits, frameworks and middleware.