Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #4817 -- Removed leading forward slashes from some urlconf exam…

…ples in the documentation.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5638 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 0be6d32c24bd70e45c2faa8d332b4de31d457646 1 parent 5a32b3a
Gary Wilson Jr. authored July 10, 2007
2  docs/model-api.txt
@@ -1871,7 +1871,7 @@ works out the correct full URL path using the URLconf, substituting the
1871 1871
 parameters you have given into the URL. For example, if your URLconf
1872 1872
 contained a line such as::
1873 1873
 
1874  
-    (r'^/people/(\d+)/$', 'people.views.details'),
  1874
+    (r'^people/(\d+)/$', 'people.views.details'),
1875 1875
 
1876 1876
 ...your model could have a ``get_absolute_url`` method that looked like this::
1877 1877
 
6  docs/overview.txt
@@ -165,9 +165,9 @@ example above::
165 165
     from django.conf.urls.defaults import *
166 166
 
167 167
     urlpatterns = patterns('',
168  
-        (r'^/articles/(\d{4})/$', 'mysite.views.year_archive'),
169  
-        (r'^/articles/(\d{4})/(\d{2})/$', 'mysite.views.month_archive'),
170  
-        (r'^/articles/(\d{4})/(\d{2})/(\d+)/$', 'mysite.views.article_detail'),
  168
+        (r'^articles/(\d{4})/$', 'mysite.views.year_archive'),
  169
+        (r'^articles/(\d{4})/(\d{2})/$', 'mysite.views.month_archive'),
  170
+        (r'^articles/(\d{4})/(\d{2})/(\d+)/$', 'mysite.views.article_detail'),
171 171
     )
172 172
 
173 173
 The code above maps URLs, as simple regular expressions, to the location of
8  docs/static_files.txt
@@ -103,10 +103,10 @@ Do this by wrapping an ``if DEBUG`` statement around the
103 103
     from django.conf import settings
104 104
 
105 105
     urlpatterns = patterns('',
106  
-        (r'^/articles/2003/$', 'news.views.special_case_2003'),
107  
-        (r'^/articles/(?P<year>\d{4})/$', 'news.views.year_archive'),
108  
-        (r'^/articles/(?P<year>\d{4})/(?P<month>\d{2})/$', 'news.views.month_archive'),
109  
-        (r'^/articles/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d+)/$', 'news.views.article_detail'),
  106
+        (r'^articles/2003/$', 'news.views.special_case_2003'),
  107
+        (r'^articles/(?P<year>\d{4})/$', 'news.views.year_archive'),
  108
+        (r'^articles/(?P<year>\d{4})/(?P<month>\d{2})/$', 'news.views.month_archive'),
  109
+        (r'^articles/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d+)/$', 'news.views.article_detail'),
110 110
     )
111 111
 
112 112
     if settings.DEBUG:
6  docs/url_dispatch.txt
@@ -317,7 +317,7 @@ Old::
317 317
     from django.conf.urls.defaults import *
318 318
 
319 319
     urlpatterns = patterns('',
320  
-        (r'^/?$', 'django.views.generic.date_based.archive_index'),
  320
+        (r'^$', 'django.views.generic.date_based.archive_index'),
321 321
         (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$', 'django.views.generic.date_based.archive_month'),
322 322
         (r'^tag/(?P<tag>\w+)/$', 'weblog.views.tag'),
323 323
     )
@@ -327,7 +327,7 @@ New::
327 327
     from django.conf.urls.defaults import *
328 328
 
329 329
     urlpatterns = patterns('django.views.generic.date_based',
330  
-        (r'^/?$', 'archive_index'),
  330
+        (r'^$', 'archive_index'),
331 331
         (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$','archive_month'),
332 332
     )
333 333
 
@@ -392,7 +392,7 @@ dictionary of extra keyword arguments to pass to the view function.
392 392
 For example::
393 393
 
394 394
     urlpatterns = patterns('blog.views',
395  
-        (r'^/blog/(?P<year>\d{4})/$', 'year_archive', {'foo': 'bar'}),
  395
+        (r'^blog/(?P<year>\d{4})/$', 'year_archive', {'foo': 'bar'}),
396 396
     )
397 397
 
398 398
 In this example, for a request to ``/blog/2005/``, Django will call the

0 notes on commit 0be6d32

Please sign in to comment.
Something went wrong with that request. Please try again.