diff options
| author | cguardia <carlos.delaguardia@gmail.com> | 2011-04-25 00:37:33 -0500 |
|---|---|---|
| committer | cguardia <carlos.delaguardia@gmail.com> | 2011-04-25 00:37:33 -0500 |
| commit | b61680ad87abcb524ae3fe846cd591c6ec1d54ef (patch) | |
| tree | e2fcd960d9119efde4a1b7eecec3880f98397d2f /docs/narr/assets.rst | |
| parent | 1b395e6d43b9450ea652d9addb675936b507ea52 (diff) | |
| parent | bb825910b3b68b4b167572fd5252cc99be88e17e (diff) | |
| download | pyramid-b61680ad87abcb524ae3fe846cd591c6ec1d54ef.tar.gz pyramid-b61680ad87abcb524ae3fe846cd591c6ec1d54ef.tar.bz2 pyramid-b61680ad87abcb524ae3fe846cd591c6ec1d54ef.zip | |
Merge branch 'master' of https://github.com/Pylons/pyramid
Diffstat (limited to 'docs/narr/assets.rst')
| -rw-r--r-- | docs/narr/assets.rst | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/docs/narr/assets.rst b/docs/narr/assets.rst index bbb673ecc..8d0e7058c 100644 --- a/docs/narr/assets.rst +++ b/docs/narr/assets.rst @@ -341,7 +341,8 @@ application's startup code. # .. every other add_route declaration should come # before this one, as it will, by default, catch all requests - config.add_route('catchall_static', '/*subpath', 'myapp.static.static_view') + config.add_route('catchall_static', '/*subpath') + config.add_view('myapp.static.static_view', route_name='catchall_static') The special name ``*subpath`` above is used by the :class:`~pyramid.view.static` view callable to signify the path of the file @@ -384,8 +385,8 @@ Or you might register it to be the view callable for a particular route: .. code-block:: python :linenos: - config.add_route('favicon', '/favicon.ico', - view='myapp.views.favicon_view') + config.add_route('favicon', '/favicon.ico') + config.add_view('myapp.views.favicon_view', route_name='favicon') Because this is a simple view callable, it can be protected with a :term:`permission` or can be configured to respond under different |
