From 184ac29278d7521841bbd94c9c6192ea9f98bd14 Mon Sep 17 00:00:00 2001 From: Sesostris Vieira Date: Thu, 16 Jun 2016 16:28:12 -0300 Subject: [PATCH] Ajusta urls para novo formato (elimina django.conf.urls.patterns) --- sigi/apps/casas/urls.py | 42 +++++++++++++-------------- sigi/apps/convenios/urls.py | 21 +++++++------- sigi/apps/diagnosticos/urls.py | 50 ++++++++++++++------------------- sigi/apps/diagnosticos/views.py | 3 +- sigi/apps/eventos/urls.py | 12 ++++---- sigi/apps/home/urls.py | 24 ++++++++-------- sigi/apps/metas/urls.py | 21 +++++++------- sigi/apps/ocorrencias/urls.py | 31 ++++++++++---------- sigi/apps/parlamentares/urls.py | 18 ++++++------ sigi/apps/saberes/urls.py | 11 +++----- sigi/apps/servicos/urls.py | 23 ++++++--------- sigi/apps/servidores/urls.py | 15 ++++------ sigi/urls.py | 17 +++++------ 13 files changed, 131 insertions(+), 157 deletions(-) diff --git a/sigi/apps/casas/urls.py b/sigi/apps/casas/urls.py index 5381364..3eb798f 100644 --- a/sigi/apps/casas/urls.py +++ b/sigi/apps/casas/urls.py @@ -1,38 +1,36 @@ # coding: utf-8 -from django.conf.urls import patterns, url - - -urlpatterns = patterns( - 'sigi.apps.casas.views', +from django.conf.urls import url +from sigi.apps.casas import views +urlpatterns = [ # Informacoes de uma casa legislativa - url(r'^casalegislativa/report_complete/$', 'report_complete', name='report-complete-all'), - url(r'^casalegislativa/(?P\w+)/report_complete/$', 'report_complete', name='report-complete-id'), + url(r'^casalegislativa/report_complete/$', views.report_complete, name='report-complete-all'), + url(r'^casalegislativa/(?P\w+)/report_complete/$', views.report_complete, name='report-complete-id'), # Reports Labels - url(r'^casalegislativa/labels/$', 'labels_report', name='labels-report-all'), - url(r'^casalegislativa/(?P\w+)/labels/$', 'labels_report', name='labels-report-id'), + url(r'^casalegislativa/labels/$', views.labels_report, name='labels-report-all'), + url(r'^casalegislativa/(?P\w+)/labels/$', views.labels_report, name='labels-report-id'), # Reports Labels Parlamentar - url(r'^casalegislativa/labels_parlamentar/$', 'labels_report_parlamentar', name='lebels-report-parlamentar-all'), - url(r'^casalegislativa/(?P\w+)/labels_parlamentar/$', 'labels_report_parlamentar', name='labels-report-parlamentar-id'), + url(r'^casalegislativa/labels_parlamentar/$', views.labels_report_parlamentar, name='lebels-report-parlamentar-all'), + url(r'^casalegislativa/(?P\w+)/labels_parlamentar/$', views.labels_report_parlamentar, name='labels-report-parlamentar-id'), # Reports labels sem presidente - url(r'^casalegislativa/labels_sem_presidente/$', 'labels_report_sem_presidente', name='labels-report-sem-presidente-all'), - url(r'^casalegislativa/(?P\w+)/labels_sem_presidente/$', 'labels_report_sem_presidente', name='labels-report-sem-presidente-id'), + url(r'^casalegislativa/labels_sem_presidente/$', views.labels_report_sem_presidente, name='labels-report-sem-presidente-all'), + url(r'^casalegislativa/(?P\w+)/labels_sem_presidente/$', views.labels_report_sem_presidente, name='labels-report-sem-presidente-id'), # Reports casas sem convenio - url(r'^casalegislativa/reports/$', 'report', name='casa-report'), - url(r'^casalegislativa/casas_sem_convenio_report/$', 'casas_sem_convenio_report', name='casas-sem-convenio-report'), + url(r'^casalegislativa/reports/$', views.report, name='casa-report'), + url(r'^casalegislativa/casas_sem_convenio_report/$', views.casas_sem_convenio_report, name='casas-sem-convenio-report'), # CSV - url(r'^casalegislativa/csv/$', 'export_csv', name='casa-export-csv'), # Error + url(r'^casalegislativa/csv/$', views.export_csv, name='casa-export-csv'), # Error # Carrinho - url(r'^casalegislativa/carrinho/$', 'visualizar_carrinho', name='visualizar-carrinho'), - url(r'^casalegislativa/carrinho/excluir_carrinho/$', 'excluir_carrinho', name='excluir-carrinho'), # Error - url(r'^casalegislativa/carrinho/deleta_itens_carrinho$', 'deleta_itens_carrinho', name='deleta-itens-carrinho'), # Error - url(r'^portfolio/$', 'portfolio', name='casas-portfolio'), - url(r'^carteira/$', 'painel_relacionamento', name='casas-carteira'), -) + url(r'^casalegislativa/carrinho/$', views.visualizar_carrinho, name='visualizar-carrinho'), + url(r'^casalegislativa/carrinho/excluir_carrinho/$', views.excluir_carrinho, name='excluir-carrinho'), # Error + url(r'^casalegislativa/carrinho/deleta_itens_carrinho$', views.deleta_itens_carrinho, name='deleta-itens-carrinho'), # Error + url(r'^portfolio/$', views.portfolio, name='casas-portfolio'), + url(r'^carteira/$', views.painel_relacionamento, name='casas-carteira'), +] diff --git a/sigi/apps/convenios/urls.py b/sigi/apps/convenios/urls.py index d3b753a..1fabc65 100644 --- a/sigi/apps/convenios/urls.py +++ b/sigi/apps/convenios/urls.py @@ -1,14 +1,13 @@ # coding: utf-8 -from django.conf.urls import patterns, url +from django.conf.urls import url +from sigi.apps.convenios import views -urlpatterns = patterns( - 'sigi.apps.convenios.views', - - url(r'^convenio/reports/$', 'report', name='convenios-report'), - url(r'^convenio/carrinho/$', 'visualizar_carrinho', name='visualizar-carrinho'), - url(r'^convenio/carrinho/excluir_carrinho/$', 'excluir_carrinho', name='excluir-carrinho'), # tagerror - url(r'^convenio/carrinho/deleta_itens_carrinho$', 'deleta_itens_carrinho', name='deleta-itens-carrinho'), # tagerror - url(r'^convenio/csv/$', 'export_csv', name='convenios-csv'), - url(r'^reportsRegiao/(?P\w+)/$', 'report_regiao', name='convenios-report_regiao_pdf'), -) +urlpatterns = [ + url(r'^convenio/reports/$', views.report, name='convenios-report'), + url(r'^convenio/carrinho/$', views.visualizar_carrinho, name='visualizar-carrinho'), + url(r'^convenio/carrinho/excluir_carrinho/$', views.excluir_carrinho, name='excluir-carrinho'), # tagerror + url(r'^convenio/carrinho/deleta_itens_carrinho$', views.deleta_itens_carrinho, name='deleta-itens-carrinho'), # tagerror + url(r'^convenio/csv/$', views.export_csv, name='convenios-csv'), + url(r'^reportsRegiao/(?P\w+)/$', views.report_regiao, name='convenios-report_regiao_pdf'), +] diff --git a/sigi/apps/diagnosticos/urls.py b/sigi/apps/diagnosticos/urls.py index 3e170d3..b1a9304 100644 --- a/sigi/apps/diagnosticos/urls.py +++ b/sigi/apps/diagnosticos/urls.py @@ -1,52 +1,44 @@ # -*- coding: utf-8 -*- -from django.conf.urls import patterns, url +from django.conf.urls import url from django.views.generic import TemplateView +from sigi.apps.diagnosticos.views import (lista, categorias, categoria_casa_legislativa, categoria_contatos, + categoria_detalhes, municipios_diagnosticados, diagnostico_pdf, graficos, + grafico_api, LOGIN_REDIRECT_URL) +from django.contrib.auth.views import login, logout - -LOGIN_REDIRECT_URL = '/diagnosticos/mobile/login' - -urlpatterns = patterns( - 'sigi.apps.diagnosticos.views', - - # Lista de Diagnósticos - url(r'^mobile/$', 'lista', name='lista_diagnosticos'), +urlpatterns = [ + url(r'^mobile/$', lista, name='lista_diagnosticos'), # Lista de Categorias - url(r'^mobile/(?P\d+)/categorias/$', - 'categorias', name='lista_categorias'), - + url(r'^mobile/(?P\d+)/categorias/$', categorias, name='lista_categorias'), + # Detalhes da Categoria da Casa Legislativa url(r'^mobile/(?P\d+)/categorias/1/$', - 'categoria_casa_legislativa', name='detalhes_categoria_casa_legislativa'), - + categoria_casa_legislativa, name='detalhes_categoria_casa_legislativa'), + # Detalhes da Categoria de Contatos url(r'^mobile/(?P\d+)/categorias/2/$', - 'categoria_contatos', name='detalhes_categoria_contatos'), - + categoria_contatos, name='detalhes_categoria_contatos'), + # Detalhes de Categorias Dinamicas url(r'^mobile/(?P\d+)/categorias/(?P\d+)/$', - 'categoria_detalhes', name='detalhes_categoria'), + categoria_detalhes, name='detalhes_categoria'), url(r'^mapa/$', TemplateView.as_view(template_name="diagnosticos/mapa.html"), name='template-mapa'), - url(r'^mundiagjson/$', 'municipios_diagnosticados', name='municipios-diagnosticados'), + url(r'^mundiagjson/$', municipios_diagnosticados, name='municipios-diagnosticados'), # Reports diagnosticos - url(r'^diagnostico/(?P\w+).pdf$', 'diagnostico_pdf', name='diagnostico-pdf'), + url(r'^diagnostico/(?P\w+).pdf$', diagnostico_pdf, name='diagnostico-pdf'), # Graficos de perguntas - url(r'^graficos/$', 'graficos', name="diagnosticos-graficos"), # tagerror - url(r'^api/$', 'grafico_api', name="diagnosticos-grafico-api"), # tagerror - -) - -urlpatterns += patterns( - 'django.contrib.auth.views', + url(r'^graficos/$', graficos, name="diagnosticos-graficos"), # tagerror + url(r'^api/$', grafico_api, name="diagnosticos-grafico-api"), # tagerror # Login do Diagnóstico - url(r'^mobile/login/$', 'login', {'template_name': + url(r'^mobile/login/$', login, {'template_name': 'diagnosticos/diagnosticos_login.html'}, name='login'), # Logout do Diagnóstico - url(r'^mobile/logout/$', 'logout', + url(r'^mobile/logout/$', logout, {'next_page': LOGIN_REDIRECT_URL}, name='logout'), -) +] diff --git a/sigi/apps/diagnosticos/views.py b/sigi/apps/diagnosticos/views.py index 2807abe..f429a50 100644 --- a/sigi/apps/diagnosticos/views.py +++ b/sigi/apps/diagnosticos/views.py @@ -14,10 +14,11 @@ from sigi.apps.diagnosticos.decorators import validate_diagnostico from sigi.apps.diagnosticos.forms import (DiagnosticoMobileForm, CasaLegislativaMobileForm, FuncionariosMobileForm) from sigi.apps.diagnosticos.models import Diagnostico, Categoria, Pergunta -from sigi.apps.diagnosticos.urls import LOGIN_REDIRECT_URL from sigi.apps.utils.decorators import login_required from sigi.shortcuts import render_to_pdf +LOGIN_REDIRECT_URL = '/diagnosticos/mobile/login' + @never_cache @login_required(login_url=LOGIN_REDIRECT_URL) diff --git a/sigi/apps/eventos/urls.py b/sigi/apps/eventos/urls.py index a648c7c..c51c46f 100644 --- a/sigi/apps/eventos/urls.py +++ b/sigi/apps/eventos/urls.py @@ -1,10 +1,10 @@ # coding: utf-8 -from django.conf.urls import patterns, url +from django.conf.urls import url +from sigi.apps.eventos import views -urlpatterns = patterns( - 'sigi.apps.eventos.views', +urlpatterns = [ # Painel de ocorrencias - url(r'^calendario/$', 'calendario', name='eventos-calendario'), - url(r'^alocacaoequipe/$', 'alocacao_equipe', name='eventos-alocacaoequipe'), -) + url(r'^calendario/$', views.calendario, name='eventos-calendario'), + url(r'^alocacaoequipe/$', views.alocacao_equipe, name='eventos-alocacaoequipe'), +] diff --git a/sigi/apps/home/urls.py b/sigi/apps/home/urls.py index 33e1e5b..4eac8ec 100644 --- a/sigi/apps/home/urls.py +++ b/sigi/apps/home/urls.py @@ -1,15 +1,15 @@ # coding: utf-8 -from django.conf.urls import patterns, url +from django.conf.urls import url +from sigi.apps.home import views -urlpatterns = patterns('sigi.apps.home.views', - url(r'^$', 'index', name='sigi_index'), - url(r'^home/resumoconvenios/$', 'resumo_convenios', name="home_resumoconvenios"), - url(r'^home/resumoseit/$', 'resumo_seit', name="home_resumoseit"), - url(r'^home/chartseit/$', 'chart_seit', name="home_chartseit"), - url(r'^home/chartconvenios/$', 'chart_convenios', name="home_chartconvenios"), - url(r'^home/chartcarteira/$', 'chart_carteira', name="home_chartcarteira"), - url(r'^home/chartperformance/$', 'chart_performance', name="home_chartperformance"), - url(r'^home/report/semconvenio/$', 'report_sem_convenio', name="home_reportsemconvenio"), - -) +urlpatterns = [ + url(r'^$', views.index, name='sigi_index'), + url(r'^home/resumoconvenios/$', views.resumo_convenios, name="home_resumoconvenios"), + url(r'^home/resumoseit/$', views.resumo_seit, name="home_resumoseit"), + url(r'^home/chartseit/$', views.chart_seit, name="home_chartseit"), + url(r'^home/chartconvenios/$', views.chart_convenios, name="home_chartconvenios"), + url(r'^home/chartcarteira/$', views.chart_carteira, name="home_chartcarteira"), + url(r'^home/chartperformance/$', views.chart_performance, name="home_chartperformance"), + url(r'^home/report/semconvenio/$', views.report_sem_convenio, name="home_reportsemconvenio"), +] diff --git a/sigi/apps/metas/urls.py b/sigi/apps/metas/urls.py index 3d89a57..eda366c 100644 --- a/sigi/apps/metas/urls.py +++ b/sigi/apps/metas/urls.py @@ -1,14 +1,13 @@ # coding: utf-8 -from django.conf.urls import patterns, url +from django.conf.urls import url +from sigi.apps.metas import views -urlpatterns = patterns( - 'sigi.apps.metas.views', - - url(r'^$', 'dashboard', name='metas-dashboardsss'), # tagerror - url(r'^mapa/$', 'mapa', name='metas-mapa'), # tagerror - url(r'^mapdata/$', 'map_data', name='metas-map_data'), - url(r'^mapsearch/$', 'map_search', name='metas-map_search'), - url(r'^mapsum/$', 'map_sum', name='metas-map_sum'), - url(r'^maplist/$', 'map_list', name='metas-map_list'), -) +urlpatterns = [ + url(r'^$', views.dashboard, name='metas-dashboardsss'), # tagerror + url(r'^mapa/$', views.mapa, name='metas-mapa'), # tagerror + url(r'^mapdata/$', views.map_data, name='metas-map_data'), + url(r'^mapsearch/$', views.map_search, name='metas-map_search'), + url(r'^mapsum/$', views.map_sum, name='metas-map_sum'), + url(r'^maplist/$', views.map_list, name='metas-map_list'), +] diff --git a/sigi/apps/ocorrencias/urls.py b/sigi/apps/ocorrencias/urls.py index f98cb08..f50aa4d 100644 --- a/sigi/apps/ocorrencias/urls.py +++ b/sigi/apps/ocorrencias/urls.py @@ -1,19 +1,18 @@ # coding: utf-8 -from django.conf.urls import patterns, url +from django.conf.urls import url +from sigi.apps.ocorrencias import views - -urlpatterns = patterns( - 'sigi.apps.ocorrencias.views', +urlpatterns = [ # Painel de ocorrencias - url(r'^painel/$', 'painel_ocorrencias', name='painel-ocorrencias'), - url(r'^painel/buscanominal/$', 'busca_nominal', {"origin": "tudo"}, name='painel-buscanominal'), - url(r'^painel/buscanominal/casa/$', 'busca_nominal', {"origin": "casa"}, name='painel-buscacasa'), - url(r'^painel/buscanominal/servidor/$', 'busca_nominal', {"origin": "servidor"}, name='painel-buscaservidor'), - url(r'^painel/buscanominal/servico/$', 'busca_nominal', {"origin": "servico"}, name='painel-buscaservico'), - url(r'^mudaprioridade/$', 'muda_prioridade', name='ocorrencia-mudaprioridade'), - url(r'^excluianexo/$', 'exclui_anexo', name='ocorrencia-excluianexo'), - url(r'^incluianexo/$', 'inclui_anexo', name='ocorrencia-incluianexo'), - url(r'^anexosnippet/$', 'anexo_snippet', name='ocorrencia-anexosnippet'), - url(r'^incluicomentario/$', 'inclui_comentario', name='ocorrencia-incluicomentario'), - url(r'^incluiocorrencia/$', 'inclui_ocorrencia', name='ocorrencia-incluiocorrencia'), -) + url(r'^painel/$', views.painel_ocorrencias, name='painel-ocorrencias'), + url(r'^painel/buscanominal/$', views.busca_nominal, {"origin": "tudo"}, name='painel-buscanominal'), + url(r'^painel/buscanominal/casa/$', views.busca_nominal, {"origin": "casa"}, name='painel-buscacasa'), + url(r'^painel/buscanominal/servidor/$', views.busca_nominal, {"origin": "servidor"}, name='painel-buscaservidor'), + url(r'^painel/buscanominal/servico/$', views.busca_nominal, {"origin": "servico"}, name='painel-buscaservico'), + url(r'^mudaprioridade/$', views.muda_prioridade, name='ocorrencia-mudaprioridade'), + url(r'^excluianexo/$', views.exclui_anexo, name='ocorrencia-excluianexo'), + url(r'^incluianexo/$', views.inclui_anexo, name='ocorrencia-incluianexo'), + url(r'^anexosnippet/$', views.anexo_snippet, name='ocorrencia-anexosnippet'), + url(r'^incluicomentario/$', views.inclui_comentario, name='ocorrencia-incluicomentario'), + url(r'^incluiocorrencia/$', views.inclui_ocorrencia, name='ocorrencia-incluiocorrencia'), +] diff --git a/sigi/apps/parlamentares/urls.py b/sigi/apps/parlamentares/urls.py index 395ef31..c83a7c6 100644 --- a/sigi/apps/parlamentares/urls.py +++ b/sigi/apps/parlamentares/urls.py @@ -1,17 +1,17 @@ # coding: utf-8 -from django.conf.urls import patterns, url +from django.conf.urls import url +from sigi.apps.parlamentares import views -urlpatterns = patterns( - 'sigi.apps.parlamentares.views', +urlpatterns = [ # Reports labels parlamentares - url(r'^parlamentar/labels/$', 'labels_report', name='labels-report-all'), - url(r'^parlamentar/(?P\w+)/labels/$', 'labels_report', name='labels-report-id'), + url(r'^parlamentar/labels/$', views.labels_report, name='labels-report-all'), + url(r'^parlamentar/(?P\w+)/labels/$', views.labels_report, name='labels-report-id'), # Carrinho - url(r'^parlamentar/carrinho/$', 'visualizar_carrinho', name='visualizar-carrinho'), - url(r'^parlamentar/carrinho/deleta_itens_carrinho$', 'deleta_itens_carrinho', name='deleta-itens-carrinho'), + url(r'^parlamentar/carrinho/$', views.visualizar_carrinho, name='visualizar-carrinho'), + url(r'^parlamentar/carrinho/deleta_itens_carrinho$', views.deleta_itens_carrinho, name='deleta-itens-carrinho'), # A view excluir_carrinho n existe ainda. - # url(r'^parlamentar/carrinho/exluir_carrinho$', 'excluir_carrinho', name='excluir-carrinho'), -) + # url(r'^parlamentar/carrinho/exluir_carrinho$', views.excluir_carrinho, name='excluir-carrinho'), +] diff --git a/sigi/apps/saberes/urls.py b/sigi/apps/saberes/urls.py index 05254fc..5024af4 100644 --- a/sigi/apps/saberes/urls.py +++ b/sigi/apps/saberes/urls.py @@ -1,14 +1,11 @@ # coding: utf-8 -from django.conf.urls import patterns, url +from django.conf.urls import url +from sigi.apps.saberes.views import cursos_sem_tutoria, cursos_com_tutoria, dashboard, pentaho_proxy -from .views import cursos_sem_tutoria, cursos_com_tutoria, dashboard, pentaho_proxy - - -urlpatterns = patterns( - 'sigi.apps.saberes.views', +urlpatterns = [ url(r'^dashboard/cursos-sem-turoria/?$', cursos_sem_tutoria, name="saberes-cursos-sem-tutoria"), url(r'^dashboard/cursos-com-turoria/?$', cursos_com_tutoria, name="saberes-cursos-com-tutoria"), url(r'^dashboard/?$', dashboard, name="saberes-dashboard-view"), url(r'^(?P(plugin|api)/.*)$', pentaho_proxy), -) +] diff --git a/sigi/apps/servicos/urls.py b/sigi/apps/servicos/urls.py index 8c91807..cf699cf 100644 --- a/sigi/apps/servicos/urls.py +++ b/sigi/apps/servicos/urls.py @@ -1,15 +1,10 @@ # coding: utf-8 -from django.conf.urls import patterns, url -from django.views.generic.base import TemplateView - -from .views import MapaView - - -urlpatterns = patterns( - 'sigi.apps.servicos.views', - - url(r'^manifesta/$', 'casa_manifesta_view', name="casa-manifesta-view"), - url(r'^munatenjson/(?P\w+)/$', 'municipios_atendidos', name="municipios-atendidos"), - url(r'^mapa/(?P\w+)/$', MapaView.as_view(), name="servicos-mapa"), - # url(r'^listacasas/(?P\w+)', 'casas_usam_servico', name="casas-usam-servico"), -) +from django.conf.urls import url +from sigi.apps.servicos import views + +urlpatterns = [ + url(r'^manifesta/$', views.casa_manifesta_view, name="casa-manifesta-view"), + url(r'^munatenjson/(?P\w+)/$', views.municipios_atendidos, name="municipios-atendidos"), + url(r'^mapa/(?P\w+)/$', views.MapaView.as_view(), name="servicos-mapa"), + # url(r'^listacasas/(?P\w+)', views.casas_usam_servico, name="casas-usam-servico"), +] diff --git a/sigi/apps/servidores/urls.py b/sigi/apps/servidores/urls.py index 0a3c33c..5183176 100644 --- a/sigi/apps/servidores/urls.py +++ b/sigi/apps/servidores/urls.py @@ -1,11 +1,8 @@ # -*- coding: utf-8 -*- -from django.conf.urls import patterns, url +from django.conf.urls import url +from sigi.apps.servidores import views - -urlpatterns = patterns( - 'sigi.apps.servidores.views', - - # Reports servidores - url(r'^servidores_por_funcao.pdf$', 'servidores_por_funcao', name='servidores-funcao-pdf'), - url(r'^servidores_por_cargo.pdf$', 'servidores_por_cargo', name='servidores-cargo-pdf'), -) +urlpatterns = [ + url(r'^servidores_por_funcao.pdf$', views.servidores_por_funcao, name='servidores-funcao-pdf'), + url(r'^servidores_por_cargo.pdf$', views.servidores_por_cargo, name='servidores-cargo-pdf'), +] diff --git a/sigi/urls.py b/sigi/urls.py index 38fe8f9..6f5a8db 100644 --- a/sigi/urls.py +++ b/sigi/urls.py @@ -1,6 +1,6 @@ #-*- coding:utf-8 -*- from django.conf import settings -from django.conf.urls import patterns, include, url +from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic.base import TemplateView @@ -11,9 +11,7 @@ from sigi.apps.saberes.views import pentaho_proxy admin.site.index_template = 'index.html' admin.autodiscover() -urlpatterns = patterns( - '', - +urlpatterns = [ url(r'^parlamentares/', include('sigi.apps.parlamentares.urls')), url(r'^casas/', include('sigi.apps.casas.urls')), url(r'^convenios/', include('sigi.apps.convenios.urls')), @@ -32,15 +30,14 @@ urlpatterns = patterns( # Suspended #url(r'^i18n/', include('django.conf.urls.i18n')), -) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) +] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) if settings.DEBUG: - urlpatterns = patterns( - '', - + from django.views.static import serve + urlpatterns = [ url(r'^404/$', TemplateView.as_view(template_name='404.html')), url(r'^500/$', TemplateView.as_view(template_name='500.html')), url(r'^503/$', TemplateView.as_view(template_name='503.html')), - url(r'^media/(?P.*)$', 'django.views.static.serve', { + url(r'^media/(?P.*)$', serve, { 'document_root': settings.MEDIA_ROOT, }), - ) + urlpatterns + ] + urlpatterns