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/starter/+package+/run.py_tmpl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'repoze/bfg/paster_templates/starter') diff --git a/repoze/bfg/paster_templates/starter/+package+/run.py_tmpl b/repoze/bfg/paster_templates/starter/+package+/run.py_tmpl index 0cfac921f..b7cd4b2c3 100644 --- a/repoze/bfg/paster_templates/starter/+package+/run.py_tmpl +++ b/repoze/bfg/paster_templates/starter/+package+/run.py_tmpl @@ -1,11 +1,11 @@ -from repoze.bfg.router import make_app +from repoze.bfg.configuration import Configurator +from {{package}}.models import get_root def app(global_config, **settings): """ This function returns a repoze.bfg.router.Router object. It is usually called by the PasteDeploy framework during ``paster serve``""" - # paster app config callback - from {{package}}.models import get_root - import {{package}} - return make_app(get_root, {{package}}, settings=settings) - + zcml_file = settings.get('configure_zcml', 'configure.zcml') + config = Configurator(root_factory=get_root, + settings=settings, zcml_file=zcml_file) + return config.make_wsgi_app() -- cgit v1.2.3