Use list, instead of 'patterns' for urlpatterns

This commit is contained in:
Saurabh Kumar 2015-05-09 22:22:57 +05:30
parent e07e436b46
commit b60e13ed31
2 changed files with 7 additions and 7 deletions

View File

@ -2,12 +2,12 @@
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, patterns, url
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = patterns('', # noqa
urlpatterns = [
url(r'^$', TemplateView.as_view(template_name='pages/home.html'), name="home"),
url(r'^about/$', TemplateView.as_view(template_name='pages/about.html'), name="about"),
@ -21,4 +21,4 @@ urlpatterns = patterns('', # noqa
# Your stuff: custom urls includes go here
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

View File

@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.conf.urls import patterns, url
from django.conf.urls import url
from . import views
urlpatterns = patterns('',
# URL pattern for the UserListView # noqa
urlpatterns = [
# URL pattern for the UserListView
url(regex=r'^$', view=views.UserListView.as_view(), name='list'),
# URL pattern for the UserRedirectView
@ -17,4 +17,4 @@ urlpatterns = patterns('',
# URL pattern for the UserUpdateView
url(regex=r'^~update/$', view=views.UserUpdateView.as_view(), name='update'),
)
]