mirror of
https://github.com/django/django.git
synced 2025-08-10 05:48:15 +00:00
[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:
parent
49419ffd05
commit
8f9dd9f256
5 changed files with 141 additions and 110 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue