[Web-SIG] Re: WSGI and Configuration
Robert Brewer
fumanchu at amor.org
Sat Nov 13 18:52:03 CET 2004
Alan Kennedy wrote:
> Well, I think that 99% of the time, configuration consists of just a
> list of name/value pairs, although the value can obviously have
complex
> structure. Given that dynamically building data structures is where
> python really shines, it should be possible to come up with something
> flexible and powerful enough to cover the vast majority of situations.
In my experience, that 99% can be served by:
environ["myapp.config"] =
{'branch1': {'leaf1': 'value1',
'leaf2': 'value2',},
'branch2': {'leafA': 'valueA'},
}
That is, a dictionary of dictionaries of strings. Using PEAK's
importString() function or my xray.py*, anything more complex can be
dynamically imported given a string value. This happens to correspond
nicely to ConfigParser, where branches are "sections" and leaves are k/v
pairs.
Or we could make all of our deployers learn yaml. Or a new wsgiml. Yuck.
Robert Brewer
MIS
Amor Ministries
fumanchu at amor.org
* http://www.aminus.org/rbre/python/xray.py
More information about the Web-SIG
mailing list