diff options
| author | Ben Bangert <ben@groovie.org> | 2010-11-03 17:23:48 -0700 |
|---|---|---|
| committer | Ben Bangert <ben@groovie.org> | 2010-11-03 17:23:48 -0700 |
| commit | 96d7897c0bc86c25afb861fb2ee61d5e4351b0dc (patch) | |
| tree | befe3932d70541a1e05aafeb508a5fef7f064166 | |
| parent | c18e10fcdbfb3954ab35d5ab32df0005a09ab044 (diff) | |
| download | pyramid-96d7897c0bc86c25afb861fb2ee61d5e4351b0dc.tar.gz pyramid-96d7897c0bc86c25afb861fb2ee61d5e4351b0dc.tar.bz2 pyramid-96d7897c0bc86c25afb861fb2ee61d5e4351b0dc.zip | |
Revert "Updated routesalchemy template to use imperative config."
This reverts commit c18e10fcdbfb3954ab35d5ab32df0005a09ab044.
| -rw-r--r-- | pyramid/paster_templates/routesalchemy/+package+/configure.zcml | 18 | ||||
| -rw-r--r-- | pyramid/paster_templates/routesalchemy/+package+/run.py_tmpl | 5 |
2 files changed, 20 insertions, 3 deletions
diff --git a/pyramid/paster_templates/routesalchemy/+package+/configure.zcml b/pyramid/paster_templates/routesalchemy/+package+/configure.zcml new file mode 100644 index 000000000..47adfbefb --- /dev/null +++ b/pyramid/paster_templates/routesalchemy/+package+/configure.zcml @@ -0,0 +1,18 @@ +<configure xmlns="http://pylonshq.com/pyramid"> + + <!-- this must be included for the view declarations to work --> + <include package="pyramid.includes" /> + + <route + pattern="" + name="home" + view=".views.my_view" + view_renderer="templates/mytemplate.pt" + /> + + <static + name="static" + path="templates/static" + /> + +</configure> diff --git a/pyramid/paster_templates/routesalchemy/+package+/run.py_tmpl b/pyramid/paster_templates/routesalchemy/+package+/run.py_tmpl index 9edcd28c8..695cd12fe 100644 --- a/pyramid/paster_templates/routesalchemy/+package+/run.py_tmpl +++ b/pyramid/paster_templates/routesalchemy/+package+/run.py_tmpl @@ -9,6 +9,7 @@ def app(global_config, **settings): It is usually called by the PasteDeploy framework during ``paster serve``. """ + zcml_file = settings.get('configure_zcml', 'configure.zcml') db_string = settings.get('db_string') if db_string is None: raise ValueError("No 'db_string' value in application configuration.") @@ -16,9 +17,7 @@ def app(global_config, **settings): initialize_sql(db_string, asbool(db_echo)) config = Configurator(settings=settings) config.begin() - config.add_static_view('static', 'templates/static') - config.add_route('home', '/', view='.views.my_view', - renderer='templates/mytemplate.pt') + config.load_zcml(zcml_file) config.end() return config.make_wsgi_app() |
