[Web-SIG] WSGI in standard library

Clark C. Evans cce at clarkevans.com
Wed Feb 15 06:50:11 CET 2006

On Mon, Feb 13, 2006 at 12:49:00PM -0800, Guido van Rossum wrote:
| There are many different ways to judge "production quality". If we're
| talking about correct, (standards-compliant, even) code, I wholly
| agree.

Fantastic.  I just don't think it is appropriate to have a "toy"
in the standard library.

On Tue, Feb 14, 2006 at 12:00:57PM -0800, Guido van Rossum wrote:
| Let's make it so. I propose to add wsgiref to the standard library and
| nothing more.

I propose we add wsgiref, but look at other implementations and
steal what ever you can from them.  This is not a huge chunk of
code -- no reason why you can't have the best combination of
features and correctness.

On Tue, Feb 14, 2006 at 11:17:37PM +0000, Alan Kennedy wrote:
| 1. CherryPy server - 407 lines (non-code lines: ~80)
| 2. Paste Server - 450 lines
|  - Supports 100 continue responses
|  - No imports from outside stdlib
|  - Provides HTTPS/SSL server, with fallback if no SSL
|  - Supports socket timeout
|  - Demo application is (imported) paste.wsgilib.dump_environ
     (dump_environ is trivial, something like it would be
      useful for a wsgilibrary
|  - Does not detect hop-by-hop headers

I'd add in one more important item:

   - Implemented as a MixIn

| My gut feeling: Ignores many parts of the WSGI spec (sendfile, strict 
| error checking), supports unnecessary stuff for stdlib, i.e. Continue 
| support, HTTPS.

HTTPS is pretty standard requirement, its a small amount of
code for a "battery"; 100 Continue is easy to drop; adding hop-by-hop
header support and sendfile isn't hard (it can be copied from wsgiref
or the reverse)

| 3. WSGIRef_onefile.py - 660 lines
|  - No imports from outside stdlib
|  - Detects hop-by-hop headers
|  - Has WSGI sendfile support
|  - Has dedicated class to manage WSGI headers list as dictionary
    -> this thing is quite huge, is it necessary; I do WSGI
       all the time and have not found it useful

|  - Has builtin demo app
| My gut feeling: WSGIRef is the sweetspot in terms of simplicity vs. 
| usability. Covers all aspects of WSGI (which is what it was designed 
| for, IIRC ;-)



More information about the Web-SIG mailing list