summaryrefslogtreecommitdiff
path: root/repoze/bfg/paster_templates/zodb
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-11-23 08:30:38 +0000
committerChris McDonough <chrism@agendaless.com>2009-11-23 08:30:38 +0000
commit44b2ca3219cf495ae0d3a66b81befdf368ef916d (patch)
tree8ca301dbb764f7c6de494a75a93915d8130511bf /repoze/bfg/paster_templates/zodb
parentbd39b16939147d667e9c483e341c0e0a14284eec (diff)
downloadpyramid-44b2ca3219cf495ae0d3a66b81befdf368ef916d.tar.gz
pyramid-44b2ca3219cf495ae0d3a66b81befdf368ef916d.tar.bz2
pyramid-44b2ca3219cf495ae0d3a66b81befdf368ef916d.zip
- 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.
Diffstat (limited to 'repoze/bfg/paster_templates/zodb')
-rw-r--r--repoze/bfg/paster_templates/zodb/+package+/run.py_tmpl9
1 files changed, 5 insertions, 4 deletions
diff --git a/repoze/bfg/paster_templates/zodb/+package+/run.py_tmpl b/repoze/bfg/paster_templates/zodb/+package+/run.py_tmpl
index e61816f9a..4fc20798d 100644
--- a/repoze/bfg/paster_templates/zodb/+package+/run.py_tmpl
+++ b/repoze/bfg/paster_templates/zodb/+package+/run.py_tmpl
@@ -1,4 +1,4 @@
-from repoze.bfg.router import make_app
+from repoze.bfg.configuration import Configurator
from repoze.zodbconn.finder import PersistentApplicationFinder
def app(global_config, **settings):
@@ -6,8 +6,6 @@ def app(global_config, **settings):
It is usually called by the PasteDeploy framework during ``paster serve``.
"""
- # paster app config callback
- import {{package}}
from {{package}}.models import appmaker
zodb_uri = settings.get('zodb_uri')
if zodb_uri is None:
@@ -16,4 +14,7 @@ def app(global_config, **settings):
finder = PersistentApplicationFinder(zodb_uri, appmaker)
def get_root(request):
return finder(request.environ)
- 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()