This link has been bookmarked by 52 people . It was first bookmarked on 23 Dec 2006, by Jussi Rasinmäki.
-
14 Jan 16
-
This short tutorial is meant to teach you a little about WSGI, and as an example a bit about the architecture that Paste has enabled and encourages.
-
At its simplest WSGI is an interface between web servers and web applications
-
This means that WSGI can be used not just between a web server an an application, but can be used at all levels for communication. This allows web applications to become more like libraries – well encapsulated and reusable, but still with rich reusable functionality.
-
- That’s an object that responds to requests. An application is just a callable object (like a function) that takes two arguments: environ and start_response.
- The environment looks a lot like a CGI environment, with keys like REQUEST_METHOD, HTTP_HOST, etc.
- The environment also has some special keys like wsgi.input (the input stream, like the body of a POST request).
- start_response is a function that starts the response – you give the status and headers here.
- Lastly the application returns an iterator with the body response (commonly this is just a list of strings, or just a list containing one string that is the entire body.)
-
-
12 Sep 15
-
18 Aug 15
-
08 Oct 12
-
27 Sep 11
-
01 Aug 11
-
02 Jan 11
-
17 May 10
-
11 May 10
-
def app(environ, start_response): start_response('200 OK', [('content-type', 'text/html')]) return ['Hello world!']
-
-
28 Feb 10
-
21 Jan 10
-
18 Oct 09
-
25 Jun 09
-
24 Jun 09
-
16 Jun 09
-
03 Jun 09
-
29 Dec 08
-
15 Dec 08
-
27 Jun 08
-
02 Jun 08
-
01 Jun 08
-
18 May 08
-
26 Apr 08
-
24 Jan 08
-
14 Oct 07
-
18 Aug 07
-
16 Aug 07
-
23 Dec 06
-
28 Nov 06
jeanjordaanThis short tutorial is meant to teach you a little about WSGI, and as an example a bit about the architecture that Paste has enabled and encourages. This isn't an introduction to all the parts of Paste -- in fact, we'll only use a few, and explain each pa
python wsgi programming web paste framework tutorial ianbicking webapp documentation
-
14 Feb 06
-
03 Feb 06
-
01 Feb 06
-
Philippe NormandThis short tutorial is meant to teach you some about WSGI, and some about the architecture that Paste enabled and encourages.
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.