@@ -227,7 +227,7 @@ You can use the ``url()`` function, instead of a tuple, as an argument to
227
227
optional extra arguments dictionary. For example::
228
228
229
229
urlpatterns = patterns('',
230
- url(r'/ index/$', index_view, name="main-view"),
230
+ url(r'^ index/$', index_view, name="main-view"),
231
231
...
232
232
)
233
233
@@ -539,8 +539,8 @@ your URLconf. For example, these two URL patterns both point to the ``archive``
539
539
view::
540
540
541
541
urlpatterns = patterns('',
542
- (r'/ archive/(\d{4})/$', archive),
543
- (r'/ archive-summary/(\d{4})/$', archive, {'summary': True}),
542
+ (r'^ archive/(\d{4})/$', archive),
543
+ (r'^ archive-summary/(\d{4})/$', archive, {'summary': True}),
544
544
)
545
545
546
546
This is completely valid, but it leads to problems when you try to do reverse
@@ -557,8 +557,8 @@ matching.
557
557
Here's the above example, rewritten to use named URL patterns::
558
558
559
559
urlpatterns = patterns('',
560
- url(r'/ archive/(\d{4})/$', archive, name="full-archive"),
561
- url(r'/ archive-summary/(\d{4})/$', archive, {'summary': True}, "arch-summary"),
560
+ url(r'^ archive/(\d{4})/$', archive, name="full-archive"),
561
+ url(r'^ archive-summary/(\d{4})/$', archive, {'summary': True}, "arch-summary"),
562
562
)
563
563
564
564
With these names in place (``full-archive`` and ``arch-summary``), you can
0 commit comments