[Web-SIG] WSGI adoption
py-web-sig at xhaus.com
Fri Nov 26 00:22:09 CET 2004
>> I'd suggest simply using plain Python as a configuration file format.
>> It's just as easy to understand and far more flexible than
[Phillip J. Eby]
> Flexibility of specifying the content isn't really a plus here. End
> user editability, and *sectionability* are more important. That is, it
> should be easy to have sections for the app, the web server, and general
> WSGI information. For that matter, it should be possible for me to
> include settings for both mod_python and Twisted in the same
> configuration file, such that each one sees only the parts it cares
> about. That way, an application developer can minimize the tuning
> knowledge needed by an application deployer, for platforms the developer
> cares about.
> IMO, most of the content of the deployment configuration is either going
> to be constants or filenames. For filenames, ConfigParser lets you
> interpolate variables, so if you want brevity of expression you can
> still do that without going to the full generality of Python.
Since I don't have a specific proposal myself, I don't want to criticise
But on reading the docs for ConfigParser, I think that it doesn't have
encoding support(?). Meaning that configuring internationalised strings
will be complex, which will definitely be problematic in a world where
most filesystems acccept unicode file names, for example.
Python has a simple and clear mechanism for declaring file encodings:
it's definitely my favoured option.
I understand Carlos' arguments against having end-users edit python
files/write programs to configure their servers. But python code
containing simple name/value pairs, lists and mappings is also pretty
simple to read and write.
Maybe we could restrict the structure of such python config files, so
that framework authors couldn't force users to learn, for example,
metaclasses to configure their software? It needn't be a
rigidly-enforced restriction, i.e. checked by an algorithm, but just a
line-in-the-sand statement in the spec. Something like "WSGI
configuration files may only contain simple python assignments to single
objects, lists of objects or dictionaries of objects. They may not
contain class definitions, function definitions, import statements, etc,
And lastly, it's got to be said: although we may dislike the awkwardness
and rigidity of XML, it is almost universally understood, at all levels
of technical ability. It is universally supported in all python
environments, and it handles encodings and i18n very gracefully.
More information about the Web-SIG