[1.7.x] Refs #23276: Removed bad examples of passing views as strings to url()

partial backport of a9fd740d22 from master
This commit is contained in:
Collin Anderson 2014-08-12 14:12:50 -04:00
parent 49419ffd05
commit 8f9dd9f256
5 changed files with 141 additions and 110 deletions

View file

@ -186,10 +186,12 @@ example above::
from django.conf.urls import patterns
from . import views
urlpatterns = patterns('',
(r'^articles/(\d{4})/$', 'news.views.year_archive'),
(r'^articles/(\d{4})/(\d{2})/$', 'news.views.month_archive'),
(r'^articles/(\d{4})/(\d{2})/(\d+)/$', 'news.views.article_detail'),
(r'^articles/(\d{4})/$', views.year_archive),
(r'^articles/(\d{4})/(\d{2})/$', views.month_archive),
(r'^articles/(\d{4})/(\d{2})/(\d+)/$', views.article_detail),
)
The code above maps URLs, as simple `regular expressions`_, to the location of