summaryrefslogtreecommitdiff
path: root/docs/narr/assets.rst
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2011-04-22 10:21:30 -0400
committerChris McDonough <chrism@plope.com>2011-04-22 10:21:30 -0400
commitc150d77248653172b487326a1059b8c0bc5056e4 (patch)
tree48b508a5e7047bc8d9ff77defaf82af87bdb2ec8 /docs/narr/assets.rst
parentfeef5257261f3c37f11571a475dbd68f603b144e (diff)
parent1612fe799b5d36d3c7c39468be55b15777730f62 (diff)
downloadpyramid-c150d77248653172b487326a1059b8c0bc5056e4.tar.gz
pyramid-c150d77248653172b487326a1059b8c0bc5056e4.tar.bz2
pyramid-c150d77248653172b487326a1059b8c0bc5056e4.zip
Merge branch 'disambiguate_add_route' of https://github.com/mmerickel/pyramid into mmerickel-disambiguate_add_route
Diffstat (limited to 'docs/narr/assets.rst')
-rw-r--r--docs/narr/assets.rst7
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