mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #23276 -- Deprecated passing views as strings to url().
This commit is contained in:
parent
2003cb23d4
commit
a9fd740d22
28 changed files with 207 additions and 182 deletions
|
@ -186,10 +186,12 @@ example above::
|
|||
|
||||
from django.conf.urls import url
|
||||
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^articles/([0-9]{4})/$', 'news.views.year_archive'),
|
||||
url(r'^articles/([0-9]{4})/([0-9]{2})/$', 'news.views.month_archive'),
|
||||
url(r'^articles/([0-9]{4})/([0-9]{2})/([0-9]+)/$', 'news.views.article_detail'),
|
||||
url(r'^articles/([0-9]{4})/$', views.year_archive),
|
||||
url(r'^articles/([0-9]{4})/([0-9]{2})/$', views.month_archive),
|
||||
url(r'^articles/([0-9]{4})/([0-9]{2})/([0-9]+)/$', 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