diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-11-16 09:38:40 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-11-16 09:38:40 +0000 |
| commit | f42df5fc3f3591d9f6bb02a37f388b0e9c1a19b4 (patch) | |
| tree | 171b5f389c201e63ac9194a1ec9b94dab74a2483 /docs/topics/http | |
| parent | aed11333f1dae7cd92e9171ef219a926b0e9cac6 (diff) | |
[1.0.X] Fixed #9472 -- Fixed a couple of URL patterns to be more consistent (and remove a misleading initial slash). Thanks, daveyjoe.
Backport of r9471 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9472 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/topics/http')
| -rw-r--r-- | docs/topics/http/urls.txt | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/topics/http/urls.txt b/docs/topics/http/urls.txt index f3030fee3d..4f94b82e47 100644 --- a/docs/topics/http/urls.txt +++ b/docs/topics/http/urls.txt @@ -227,7 +227,7 @@ You can use the ``url()`` function, instead of a tuple, as an argument to optional extra arguments dictionary. For example:: urlpatterns = patterns('', - url(r'/index/$', index_view, name="main-view"), + url(r'^index/$', index_view, name="main-view"), ... ) @@ -539,8 +539,8 @@ your URLconf. For example, these two URL patterns both point to the ``archive`` view:: urlpatterns = patterns('', - (r'/archive/(\d{4})/$', archive), - (r'/archive-summary/(\d{4})/$', archive, {'summary': True}), + (r'^archive/(\d{4})/$', archive), + (r'^archive-summary/(\d{4})/$', archive, {'summary': True}), ) This is completely valid, but it leads to problems when you try to do reverse @@ -557,8 +557,8 @@ matching. Here's the above example, rewritten to use named URL patterns:: urlpatterns = patterns('', - url(r'/archive/(\d{4})/$', archive, name="full-archive"), - url(r'/archive-summary/(\d{4})/$', archive, {'summary': True}, "arch-summary"), + url(r'^archive/(\d{4})/$', archive, name="full-archive"), + url(r'^archive-summary/(\d{4})/$', archive, {'summary': True}, "arch-summary"), ) With these names in place (``full-archive`` and ``arch-summary``), you can |
