[Web-SIG] WSGI deployment: an experiment
Ian Bicking
ianb at colorstudy.com
Fri Jul 29 18:22:42 CEST 2005
Ian Bicking wrote:
> I've created a branch in Paste with a rough experiment in WSGI
> deployment, declarative but (I think) more general than what's been
> discussed. The branch is at:
>
> http://svn.pythonpaste.org/Paste/branches/wsgi-deployment-experiment/
I've updated the implementation, taking ConfigParser out of the public
interface, and cleaning things up some. The config files stay the same
(though now you can reference external files with file:, where you would
have referenced other sections), but since the Python side is cleaned up
here's an example of how the pipeline construct is implemented:
def make_pipeline(context):
pipeline = context.app_config.get('pipeline', '').split()
filters = pipeline[:-1]
filters.reverse()
app_name = pipeline[-1]
deploy = context.deployment_config
app = deploy.make_app(app_name)
for filter_name in filters:
wsgi_filter = deploy.make_filter(filter_name)
app = wsgi_filter(app)
return app
The context object has a reference both to the local configuration
values (context.app_config), and the larger configuration file
(context.deployment_config).
--
Ian Bicking / ianb at colorstudy.com / http://blog.ianbicking.org
More information about the Web-SIG
mailing list