diff --git a/docs/ref/class-based-views/generic-date-based.txt b/docs/ref/class-based-views/generic-date-based.txt index 08d8a9e8666..81b42e09827 100644 --- a/docs/ref/class-based-views/generic-date-based.txt +++ b/docs/ref/class-based-views/generic-date-based.txt @@ -593,7 +593,7 @@ DateDetailView from django.views.generic.dates import DateDetailView urlpatterns = [ - url(r'^(?P[0-9]+)/(?P[-\w]+)/(?P[0-9]+)/(?P[0-9]+)/$', + url(r'^(?P[0-9]{4})/(?P[-\w]+)/(?P[0-9]+)/(?P[0-9]+)/$', DateDetailView.as_view(model=Article, date_field="pub_date"), name="archive_date_detail"), ] diff --git a/docs/ref/class-based-views/generic-display.txt b/docs/ref/class-based-views/generic-display.txt index 1ca81255011..5dc03913193 100644 --- a/docs/ref/class-based-views/generic-display.txt +++ b/docs/ref/class-based-views/generic-display.txt @@ -59,7 +59,7 @@ DetailView from article.views import ArticleDetailView urlpatterns = [ - url(r'^(?P[-_\w]+)/$', ArticleDetailView.as_view(), name='article-detail'), + url(r'^(?P[-\w]+)/$', ArticleDetailView.as_view(), name='article-detail'), ] **Example myapp/article_detail.html**: