Skip to content

Commit 0be6d32

Browse files
committed
Fixed #4817 -- Removed leading forward slashes from some urlconf examples in the documentation.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5638 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent 5a32b3a commit 0be6d32

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

docs/model-api.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1871,7 +1871,7 @@ works out the correct full URL path using the URLconf, substituting the
18711871
parameters you have given into the URL. For example, if your URLconf
18721872
contained a line such as::
18731873

1874-
(r'^/people/(\d+)/$', 'people.views.details'),
1874+
(r'^people/(\d+)/$', 'people.views.details'),
18751875

18761876
...your model could have a ``get_absolute_url`` method that looked like this::
18771877

docs/overview.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ example above::
165165
from django.conf.urls.defaults import *
166166

167167
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'),
171171
)
172172

173173
The code above maps URLs, as simple regular expressions, to the location of

docs/static_files.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ Do this by wrapping an ``if DEBUG`` statement around the
103103
from django.conf import settings
104104

105105
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'),
110110
)
111111

112112
if settings.DEBUG:

docs/url_dispatch.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ Old::
317317
from django.conf.urls.defaults import *
318318

319319
urlpatterns = patterns('',
320-
(r'^/?$', 'django.views.generic.date_based.archive_index'),
320+
(r'^$', 'django.views.generic.date_based.archive_index'),
321321
(r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$', 'django.views.generic.date_based.archive_month'),
322322
(r'^tag/(?P<tag>\w+)/$', 'weblog.views.tag'),
323323
)
@@ -327,7 +327,7 @@ New::
327327
from django.conf.urls.defaults import *
328328

329329
urlpatterns = patterns('django.views.generic.date_based',
330-
(r'^/?$', 'archive_index'),
330+
(r'^$', 'archive_index'),
331331
(r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$','archive_month'),
332332
)
333333

@@ -392,7 +392,7 @@ dictionary of extra keyword arguments to pass to the view function.
392392
For example::
393393

394394
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'}),
396396
)
397397

398398
In this example, for a request to ``/blog/2005/``, Django will call the

0 commit comments

Comments
 (0)