Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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. gdub authored
2  docs/model-api.txt
View
@@ -1871,7 +1871,7 @@ works out the correct full URL path using the URLconf, substituting the
parameters you have given into the URL. For example, if your URLconf
contained a line such as::
- (r'^/people/(\d+)/$', 'people.views.details'),
+ (r'^people/(\d+)/$', 'people.views.details'),
...your model could have a ``get_absolute_url`` method that looked like this::
6 docs/overview.txt
View
@@ -165,9 +165,9 @@ example above::
from django.conf.urls.defaults import *
urlpatterns = patterns('',
- (r'^/articles/(\d{4})/$', 'mysite.views.year_archive'),
- (r'^/articles/(\d{4})/(\d{2})/$', 'mysite.views.month_archive'),
- (r'^/articles/(\d{4})/(\d{2})/(\d+)/$', 'mysite.views.article_detail'),
+ (r'^articles/(\d{4})/$', 'mysite.views.year_archive'),
+ (r'^articles/(\d{4})/(\d{2})/$', 'mysite.views.month_archive'),
+ (r'^articles/(\d{4})/(\d{2})/(\d+)/$', 'mysite.views.article_detail'),
)
The code above maps URLs, as simple regular expressions, to the location of
8 docs/static_files.txt
View
@@ -103,10 +103,10 @@ Do this by wrapping an ``if DEBUG`` statement around the
from django.conf import settings
urlpatterns = patterns('',
- (r'^/articles/2003/$', 'news.views.special_case_2003'),
- (r'^/articles/(?P<year>\d{4})/$', 'news.views.year_archive'),
- (r'^/articles/(?P<year>\d{4})/(?P<month>\d{2})/$', 'news.views.month_archive'),
- (r'^/articles/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d+)/$', 'news.views.article_detail'),
+ (r'^articles/2003/$', 'news.views.special_case_2003'),
+ (r'^articles/(?P<year>\d{4})/$', 'news.views.year_archive'),
+ (r'^articles/(?P<year>\d{4})/(?P<month>\d{2})/$', 'news.views.month_archive'),
+ (r'^articles/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d+)/$', 'news.views.article_detail'),
)
if settings.DEBUG:
6 docs/url_dispatch.txt
View
@@ -317,7 +317,7 @@ Old::
from django.conf.urls.defaults import *
urlpatterns = patterns('',
- (r'^/?$', 'django.views.generic.date_based.archive_index'),
+ (r'^$', 'django.views.generic.date_based.archive_index'),
(r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$', 'django.views.generic.date_based.archive_month'),
(r'^tag/(?P<tag>\w+)/$', 'weblog.views.tag'),
)
@@ -327,7 +327,7 @@ New::
from django.conf.urls.defaults import *
urlpatterns = patterns('django.views.generic.date_based',
- (r'^/?$', 'archive_index'),
+ (r'^$', 'archive_index'),
(r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$','archive_month'),
)
@@ -392,7 +392,7 @@ dictionary of extra keyword arguments to pass to the view function.
For example::
urlpatterns = patterns('blog.views',
- (r'^/blog/(?P<year>\d{4})/$', 'year_archive', {'foo': 'bar'}),
+ (r'^blog/(?P<year>\d{4})/$', 'year_archive', {'foo': 'bar'}),
)
In this example, for a request to ``/blog/2005/``, Django will call the
Please sign in to comment.
Something went wrong with that request. Please try again.