From 44b2ca3219cf495ae0d3a66b81befdf368ef916d Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 23 Nov 2009 08:30:38 +0000 Subject: - The ``repoze.bfg.router.make_app`` function is now nominally deprecated. Its import and usage does not throw a warning, nor will it probably ever disappear. However, using a ``repoze.bfg.configuration.Configurator`` class is now the preferred way to generate a WSGI application. - The ``run.py`` module in various ``repoze.bfg`` ``paster`` templates now use a ``repoze.bfg.configuration.Configurator`` class instead of the (now-legacy) ``repoze.bfg.router.make_app`` function to produce a WSGI application. --- repoze/bfg/paster_templates/routesalchemy/+package+/run.py_tmpl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'repoze/bfg/paster_templates/routesalchemy') diff --git a/repoze/bfg/paster_templates/routesalchemy/+package+/run.py_tmpl b/repoze/bfg/paster_templates/routesalchemy/+package+/run.py_tmpl index d5a0f9326..e0e705224 100644 --- a/repoze/bfg/paster_templates/routesalchemy/+package+/run.py_tmpl +++ b/repoze/bfg/paster_templates/routesalchemy/+package+/run.py_tmpl @@ -1,6 +1,5 @@ -from repoze.bfg.router import make_app +from repoze.bfg.configuration import Configurator -import {{package}} from {{package}}.models import DBSession from {{package}}.models import initialize_sql @@ -23,5 +22,7 @@ def app(global_config, **settings): if db_string is None: raise ValueError("No 'db_string' value in application configuration.") initialize_sql(db_string) - return make_app(None, {{package}}, settings=settings) + zcml_file = settings.get('configure_zcml', 'configure.zcml') + config = Configurator(settings=settings, zcml_file=zcml_file) + return config.make_wsgi_app() -- cgit v1.2.3