[Web-SIG] Generic configuration

Alex Morega alex at grep.ro
Tue Mar 16 16:35:29 CET 2010


This is not really a WSGI question, it's more into general configuration, but I don't know of a better place to ask it.

Paster config files allow you to hook up WSGI applications, middleware, and a server, plus some (undocumented?) magic configuration of the logging module. But what about random components, like a database? Ideally I'd like to specify a factory for database connections and give it some parameters; this would return a reference to a new database connection. I could then pass this reference to my wsgi app or middleware.

Apparently the pattern is to perform this database configuration as part of a wsgi middleware, but that feels unnatural. Or one could do this outside of the paste configuration file, but that just splits the configuration needlessly into several pieces. Am I missing something obvious?

-- Alex

More information about the Web-SIG mailing list