summaryrefslogtreecommitdiff
path: root/docs/narr/MyProject/myproject
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 /docs/narr/MyProject/myproject
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 'docs/narr/MyProject/myproject')
-rw-r--r--docs/narr/MyProject/myproject/configure.zcml1
-rw-r--r--docs/narr/MyProject/myproject/run.py12
2 files changed, 7 insertions, 6 deletions
diff --git a/docs/narr/MyProject/myproject/configure.zcml b/docs/narr/MyProject/myproject/configure.zcml
index 038f04da4..fe9633fe1 100644
--- a/docs/narr/MyProject/myproject/configure.zcml
+++ b/docs/narr/MyProject/myproject/configure.zcml
@@ -1,6 +1,5 @@
<configure xmlns="http://namespaces.repoze.org/bfg">
- <!-- this must be included for the view declarations to work -->
<include package="repoze.bfg.includes" />
<view
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()
+