[Web-SIG] WSGI and Configuration
Ian Bicking
ianb at colorstudy.com
Sat Nov 13 00:24:07 CET 2004
Robert Brewer wrote:
> Ian Bicking wrote:
>
>>Has anyone thought about what configuration might look like in a WSGI
>>context? I'd like to set up some interface where
>>configuration can be
>>shared between frameworks. It's also important to me that
>>configuration
>>can be local in some fashion, not process- or installation-wide. For
>>instance, override some configuration values for a specific
>>URL hierarchy.
>
>
> Given: Application <-> gateway <-> ... <-> gateway <-> server
>
> I can't think of any config data that would mean anything to any WSGI
> layer other than the application. Can you give an example of such?
Well, sure. WSGIKit implements a lot of the pieces as middleware, and
most of them could use some configuration. Right now that configuration
is in the constructor (i.e., keyword arguments to the middleware).
For instance URL Parsing is middleware. You tell the URL parser where
to look for applications, and it delegates to the application it finds.
It needs configuration to tell it where to look, how to map
extensions, what files are private, etc. Sessions are also middleware,
and obviously could use some configuration. One thing I'm dealing with
now is the notion of an application root and working directory (since
Webware has these notions, but WSGI doesn't); those will probably end up
being configuration values.
Hmm... but now I'm feeling confused about it. I'd like the session
middleware to adopt configuration as it is defined when the session is
used (which may be later than when the middleware is first invoked). So
I don't know how that fits into it all.
--
Ian Bicking / ianb at colorstudy.com / http://blog.ianbicking.org
More information about the Web-SIG
mailing list