To help further my understanding of WSGI I'm looking for a diagram which explains the flow of an application, from webserver (eg. apache) through a number of middlewares to "code" (as in, the print "hello world"
bit).
I've read various articles regarding WSGI from wsgi.org, but it's still not "clicking" for me and as for diagrams Google isn't bringing anything useful back except this for django which, while interesting, is expecting the user to understand how middleware links-up and such.
Since "a picture is worth a thousand words", are there any diagrams out there which get a bit lower/more simplistic than this?
I've been looking for a diagram explaining WSGI flow for some time, too. That's why I was very happy when I found this topic. I had high expectation of what I was going to see knowing how good Ian Bicking is at writing Python. Nevertheless, I gained literally nothing by looking at Ian's fancy tubes (diagram?). That's why I decided to draw one myself. I hope it will help someone understand how WSGI flow works. As long as you have suggestions how to make it better I'm open to modify it. It was created with LUCIDCHART webapp. The original diagram you can find here and the high quality PNG is here.
I like the diagram from Ian Bicking's WSGI - A Series of Tubes.
I don't know if I can provide the answer you are looking for but the diagram you linked to shows more than just wsgi. The wsgi layer ends at the second line on the diagram. After that it's application specific.
WSGI is more an interface definition or contract that boils down to somehow you provide a function which takes a dictionary (environ) which represents the contents of the current request. and a function to call when you are ready to start the response(start_response).
The start_response method that you call needs a HTTP status code('200 OK') and a list of HTTP headers([('content-type', 'text/html')]).
def say_hello(envron={},start_response):
start_response('200 OK', [('content-type', 'text/html')])
return ["Hello from WSGI"]
Linking up your web server to your wsgi app is specific to your webserver I think and information on how the webserver arrives at the environ dictionary and a callback for your code to call is the webserver magic that you probably don't need to be concerned about. And as long as you obey the protocol, the webserver doesn't need to care how you arrived at your list of output that constitutes your response from your application.
The Paste documentation helped me a LOT. You may find it useful. BTW, Paste is a bunch of useful things that help you utilize WSGI.And the docs are very good for understanding how to use WSGI and by extension Paste.
I know you asked for a diagram sorry. :(