summaryrefslogtreecommitdiff
path: root/docs/porting.rst
diff options
context:
space:
mode:
authorhuanghao <huang1hao@gmail.com>2015-04-21 11:40:53 +0800
committerhuanghao <huang1hao@gmail.com>2015-04-21 11:40:53 +0800
commit38808bd3755c61b72400e92da15c906c8bc41fd5 (patch)
tree157966e748c5fb4e003fcd50698ae6d498c2de91 /docs/porting.rst
parentf30dddcfebd782062b80fd78e32cfd6fd601dd86 (diff)
downloadroutes-38808bd3755c61b72400e92da15c906c8bc41fd5.tar.gz
Fix wrong url pattern
There must be leading slashes in order to match
Diffstat (limited to 'docs/porting.rst')
-rw-r--r--docs/porting.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/porting.rst b/docs/porting.rst
index f54c7b3..82e538c 100644
--- a/docs/porting.rst
+++ b/docs/porting.rst
@@ -37,7 +37,7 @@ When the URL is looked up, it should be matched against the Mapper. When
matching an incoming URL, it is assumed that the URL path is the only string
being matched. All query args should be stripped before matching::
- m.connect('articles/{year}/{month}', controller='blog', action='view', year=None)
+ m.connect('/articles/{year}/{month}', controller='blog', action='view', year=None)
m.match('/articles/2003/10')
# {'controller':'blog', 'action':'view', 'year':'2003', 'month':'10'}
@@ -46,7 +46,7 @@ Matching a URL will return a dict of the match results, if you'd like to
differentiate between where the argument came from you can use routematch which
will return the Route object that has all these details::
- m.connect('articles/{year}/{month}', controller='blog', action='view', year=None)
+ m.connect('/articles/{year}/{month}', controller='blog', action='view', year=None)
result = m.routematch('/articles/2003/10')
# result is a tuple of the match dict and the Route object