WSGI Server(gateway) executes application(framework) code. Middleware exists to relay messages between the server and the application. Gunicorn is a WSGI server. Werkzeug is a WSGI middleware Flask is a WSGI application (embedding Werkzeug) def application(environ, start_response): start_response('200 OK', [('Content-Type', 'text/plain')]) yield 'Hello, World\n' http://wsgi.readthedocs.io/en/latest/ https://www.python.org/dev/peps/pep-3333/ https://en.wikipedia.org/wiki/Web_Server_Gateway_Interface