summaryrefslogtreecommitdiff
path: root/docs/narr/MyProject/myproject/run.py
diff options
context:
space:
mode:
Diffstat (limited to 'docs/narr/MyProject/myproject/run.py')
-rw-r--r--docs/narr/MyProject/myproject/run.py12
1 files changed, 7 insertions, 5 deletions
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()
+