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. --- docs/narr/MyProject/myproject/run.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'docs/narr/MyProject/myproject/run.py') diff --git a/docs/narr/MyProject/myproject/run.py b/docs/narr/MyProject/myproject/run.py index 65cd6dfe6..a9d9973bd 100644 --- a/docs/narr/MyProject/myproject/run.py +++ b/docs/narr/MyProject/myproject/run.py @@ -1,11 +1,13 @@ -from repoze.bfg.router import make_app +from repoze.bfg.configuration import Configurator +from myproject.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 myproject.models import get_root - import myproject - return make_app(get_root, myproject, 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