[Web-SIG] Standardised configuration and temporary directories.
Alan Kennedy
py-web-sig at xhaus.com
Mon Sep 6 14:02:45 CEST 2004
[Alan Kennedy]
>>2. Standardised parameter configuration and specification.
[Paul Boddie]
> As you've said, various frameworks provide mechanisms for specifying
> parameters, yet this means that there isn't a single method of
> administration for developers or users who don't care enough about
> those frameworks to know how to deal with them all. I'm inclined to
> think that better tools could be the answer here - if you have a
> simple configuration file reminiscent of Webware's .config files
> (which are Python modules with simple dictionaries or attributes)
> then different tools could produce Apache .conf files or Java
> Servlet web.xml files, for example.
Paul, thanks for taking the time to reply.
On thinking about the configuration issue further on the way into work,
I've changed my mind :-)
The original two options I presented for configuration were
A: By a specialised middleware component.
B: In the server configuration file. (I will now call this the "platform
configuration file").
I originally thought that option B was the best, but now I think
differently. And from what I read from your post, Paul, I think we're in
agreement.
Configuring the middleware stack is really the entire purpose of a
python WSGI server. The platform in which the server and application
reside, e.g. Apache, CGI, Tomcat, etc, should not be relevant. Instead,
in an ideal scenario, the entire python application, i.e. server +
middleware + configuration, should be portable to another platform(+WSGI
layer).
If this is to be the case, then the middleware and its configuration
would be best kept under centralised python control, which would
facilitate maximum portability between platforms.
Conversely, as little as possible should be kept in the platform
configuration file: ideally platforms should be the thinnest possible
layer required to deliver WSGI requests to the python WSGI server.
Which leads to the question of how best to configure middleware, in the
server configuration. Taking the example of the session handling
middleware:-
1. The server configuration specifies the middleware stack to be
constructed for responding to requests. Parameters for specific pieces
of middleware could be specified as parameters to the constructors for
each component. For example, configuring session handling could go like this
middleware_stack.append
(
my_fancy_session_handler
(
cookies=True, storage_dir='/var/session_dir'
)
)
2. Or there could be some standardised way for a server to specify
config values to middleware components, e.g.
middleware_config['my_fancy_sessions.cookies'] = True
middleware_config['my_fancy_sessions.storage_dir'] = '/var/session_dir'
middleware_stack.append(my_fancy_session_handler())
And there's probably a few other different ways to do it as well.
Although I know we're firmly in the realm of server-specific
configuration here, an area where WSGI may need to remain agnostic, it
would be nice to standardise these configuration issues, in order to
maximize portability of servers, middleware and configuration.
Regards,
Alan.
More information about the Web-SIG
mailing list