diff options
| author | Ben Bangert <ben@groovie.org> | 2010-11-03 16:50:02 -0700 |
|---|---|---|
| committer | Ben Bangert <ben@groovie.org> | 2010-11-03 16:50:02 -0700 |
| commit | c18e10fcdbfb3954ab35d5ab32df0005a09ab044 (patch) | |
| tree | 3e7d961a967ae92dd3642169248685532795c007 | |
| parent | 84e445db4cce4d9f29bf76efa73291c48989267c (diff) | |
| download | pyramid-c18e10fcdbfb3954ab35d5ab32df0005a09ab044.tar.gz pyramid-c18e10fcdbfb3954ab35d5ab32df0005a09ab044.tar.bz2 pyramid-c18e10fcdbfb3954ab35d5ab32df0005a09ab044.zip | |
Updated routesalchemy template to use imperative config.
| -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, 3 insertions, 20 deletions
diff --git a/pyramid/paster_templates/routesalchemy/+package+/configure.zcml b/pyramid/paster_templates/routesalchemy/+package+/configure.zcml deleted file mode 100644 index 47adfbefb..000000000 --- a/pyramid/paster_templates/routesalchemy/+package+/configure.zcml +++ /dev/null @@ -1,18 +0,0 @@ -<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 695cd12fe..9edcd28c8 100644 --- a/pyramid/paster_templates/routesalchemy/+package+/run.py_tmpl +++ b/pyramid/paster_templates/routesalchemy/+package+/run.py_tmpl @@ -9,7 +9,6 @@ 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.") @@ -17,7 +16,9 @@ def app(global_config, **settings): initialize_sql(db_string, asbool(db_echo)) config = Configurator(settings=settings) config.begin() - config.load_zcml(zcml_file) + config.add_static_view('static', 'templates/static') + config.add_route('home', '/', view='.views.my_view', + renderer='templates/mytemplate.pt') config.end() return config.make_wsgi_app() |
