From b60e13ed31ccfb67167290bf49c08901675f6d56 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Date: Sat, 9 May 2015 22:22:57 +0530 Subject: [PATCH] Use list, instead of 'patterns' for urlpatterns --- {{cookiecutter.repo_name}}/config/urls.py | 6 +++--- .../{{cookiecutter.repo_name}}/users/urls.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/{{cookiecutter.repo_name}}/config/urls.py b/{{cookiecutter.repo_name}}/config/urls.py index a8648696..f0f24081 100644 --- a/{{cookiecutter.repo_name}}/config/urls.py +++ b/{{cookiecutter.repo_name}}/config/urls.py @@ -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) diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/urls.py b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/urls.py index 8681f9ec..cc270b64 100644 --- a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/urls.py +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/urls.py @@ -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'), -) +]