summaryrefslogtreecommitdiff
path: root/docs/tutorials/wiki2/authorization.rst
diff options
context:
space:
mode:
authorthapar <rajthapar@gmail.com>2014-03-17 20:16:44 -0400
committerthapar <rajthapar@gmail.com>2014-03-17 20:16:44 -0400
commitee824a80bab0b30f7f8f466a9c93765b35c1c677 (patch)
treefd1ef2ac5eccfe186d0ca974f5f307add228e81a /docs/tutorials/wiki2/authorization.rst
parentca3dcdc7f4c0d4a1a836a5d16f191aad4ee460cf (diff)
downloadpyramid-ee824a80bab0b30f7f8f466a9c93765b35c1c677.tar.gz
pyramid-ee824a80bab0b30f7f8f466a9c93765b35c1c677.tar.bz2
pyramid-ee824a80bab0b30f7f8f466a9c93765b35c1c677.zip
Added note to place login/logout route definitions before `/{pagename}` route
Resolves https://github.com/Pylons/pyramid/issues/1274
Diffstat (limited to 'docs/tutorials/wiki2/authorization.rst')
-rw-r--r--docs/tutorials/wiki2/authorization.rst13
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/tutorials/wiki2/authorization.rst b/docs/tutorials/wiki2/authorization.rst
index 1e5d0dcbf..1417dbdd8 100644
--- a/docs/tutorials/wiki2/authorization.rst
+++ b/docs/tutorials/wiki2/authorization.rst
@@ -207,6 +207,19 @@ routes:
:linenos:
:language: python
+.. note:: These lines must be added `before` this ``view_page`` route
+ definition:
+ .. literalinclude:: src/authorization/tutorial/__init__.py
+ :lines: 32
+ :linenos:
+ :language: python
+ This is because ``view_page``'s route definition uses a catch-all
+ "replacement marker" ``/{pagename}`` (see :ref:_route_pattern_syntax )
+ which will catch any route that was not already caught by any
+ route listed above it in ``__init__.py``. Hence, for ``login`` and
+ ``logout`` views to have the opportunity of being matched
+ (or "caught"), they must be above ``/{pagename}``.
+
Add Login and Logout Views
~~~~~~~~~~~~~~~~~~~~~~~~~~