diff options
Diffstat (limited to 'docs/narr/MyProject')
| -rw-r--r-- | docs/narr/MyProject/myproject/configure.zcml | 1 | ||||
| -rw-r--r-- | docs/narr/MyProject/myproject/run.py | 12 |
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() + |
