[Web-SIG] Alternative to threading.local, based on the stack
manlio_perillo at libero.it
Mon Jul 7 18:36:14 CEST 2008
Ian Bicking ha scritto:
> Manlio Perillo wrote:
I'm adding web-sig in Cc.
>> I'm developing a WSGI framework with all these (and other) ideas:
>> Its still not documented, so I have not yet made an official
>> The main design goal is to keep the level of the interface as low
>> level as possible.
>> I don't like additional interfaces (like Request and Response) objects
>> around the WSGI dictionary, and I don't like frameworks like Django
>> that completely hides the WSGI interface.
> Have you tried webob? My first run as Paste avoided wrappers around
> those objects, but an object interface has been very helpful.
I have not tried it, but I have read the code (as I have read the code
In principle I'm against using additional interface, and one of the
reason I wrote wsgix is to have a prof of concept, for trying to
understand if it is feasible to write a WSGI application using an
wsgix (+ mod_wsgi for Nginx) has the same role as Paste, but I have
decided to use a rather different approach.
As an example, in Paste you have choosed to using config dictionary for
middleware configuration, that is, you have middleware factories.
In wsgix it is very different.
As an example:
There are no factories.
The configuration is read (and globally cached) at request time from the
With Nginx, configuration parameters can be defined in the server
There is an helper class:
that helps with the parsing.
There is also a middleware:
that reads the configuration from a YAML file, and merge it into the
Of course it's all a matter of personal taste :).
The goal is to have the possibility to write "truly" reusable
middlewares, that are easy to "plug" inside any WSGI server (almost all
of configuration parameters have default values).
More information about the Web-SIG