Browse Source

Ajusta urls para novo formato (elimina django.conf.urls.patterns)

atendimento
Sesostris Vieira 9 years ago
parent
commit
184ac29278
  1. 42
      sigi/apps/casas/urls.py
  2. 21
      sigi/apps/convenios/urls.py
  3. 44
      sigi/apps/diagnosticos/urls.py
  4. 3
      sigi/apps/diagnosticos/views.py
  5. 12
      sigi/apps/eventos/urls.py
  6. 24
      sigi/apps/home/urls.py
  7. 21
      sigi/apps/metas/urls.py
  8. 31
      sigi/apps/ocorrencias/urls.py
  9. 18
      sigi/apps/parlamentares/urls.py
  10. 11
      sigi/apps/saberes/urls.py
  11. 23
      sigi/apps/servicos/urls.py
  12. 15
      sigi/apps/servidores/urls.py
  13. 17
      sigi/urls.py

42
sigi/apps/casas/urls.py

@ -1,38 +1,36 @@
# coding: utf-8 # coding: utf-8
from django.conf.urls import patterns, url from django.conf.urls import url
from sigi.apps.casas import views
urlpatterns = patterns(
'sigi.apps.casas.views',
urlpatterns = [
# Informacoes de uma casa legislativa # Informacoes de uma casa legislativa
url(r'^casalegislativa/report_complete/$', 'report_complete', name='report-complete-all'), url(r'^casalegislativa/report_complete/$', views.report_complete, name='report-complete-all'),
url(r'^casalegislativa/(?P<id>\w+)/report_complete/$', 'report_complete', name='report-complete-id'), url(r'^casalegislativa/(?P<id>\w+)/report_complete/$', views.report_complete, name='report-complete-id'),
# Reports Labels # Reports Labels
url(r'^casalegislativa/labels/$', 'labels_report', name='labels-report-all'), url(r'^casalegislativa/labels/$', views.labels_report, name='labels-report-all'),
url(r'^casalegislativa/(?P<id>\w+)/labels/$', 'labels_report', name='labels-report-id'), url(r'^casalegislativa/(?P<id>\w+)/labels/$', views.labels_report, name='labels-report-id'),
# Reports Labels Parlamentar # Reports Labels Parlamentar
url(r'^casalegislativa/labels_parlamentar/$', 'labels_report_parlamentar', name='lebels-report-parlamentar-all'), url(r'^casalegislativa/labels_parlamentar/$', views.labels_report_parlamentar, name='lebels-report-parlamentar-all'),
url(r'^casalegislativa/(?P<id>\w+)/labels_parlamentar/$', 'labels_report_parlamentar', name='labels-report-parlamentar-id'), url(r'^casalegislativa/(?P<id>\w+)/labels_parlamentar/$', views.labels_report_parlamentar, name='labels-report-parlamentar-id'),
# Reports labels sem presidente # Reports labels sem presidente
url(r'^casalegislativa/labels_sem_presidente/$', 'labels_report_sem_presidente', name='labels-report-sem-presidente-all'), url(r'^casalegislativa/labels_sem_presidente/$', views.labels_report_sem_presidente, name='labels-report-sem-presidente-all'),
url(r'^casalegislativa/(?P<id>\w+)/labels_sem_presidente/$', 'labels_report_sem_presidente', name='labels-report-sem-presidente-id'), url(r'^casalegislativa/(?P<id>\w+)/labels_sem_presidente/$', views.labels_report_sem_presidente, name='labels-report-sem-presidente-id'),
# Reports casas sem convenio # Reports casas sem convenio
url(r'^casalegislativa/reports/$', 'report', name='casa-report'), url(r'^casalegislativa/reports/$', views.report, name='casa-report'),
url(r'^casalegislativa/casas_sem_convenio_report/$', 'casas_sem_convenio_report', name='casas-sem-convenio-report'), url(r'^casalegislativa/casas_sem_convenio_report/$', views.casas_sem_convenio_report, name='casas-sem-convenio-report'),
# CSV # 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 # Carrinho
url(r'^casalegislativa/carrinho/$', 'visualizar_carrinho', name='visualizar-carrinho'), url(r'^casalegislativa/carrinho/$', views.visualizar_carrinho, name='visualizar-carrinho'),
url(r'^casalegislativa/carrinho/excluir_carrinho/$', 'excluir_carrinho', name='excluir-carrinho'), # Error url(r'^casalegislativa/carrinho/excluir_carrinho/$', views.excluir_carrinho, name='excluir-carrinho'), # Error
url(r'^casalegislativa/carrinho/deleta_itens_carrinho$', 'deleta_itens_carrinho', name='deleta-itens-carrinho'), # Error url(r'^casalegislativa/carrinho/deleta_itens_carrinho$', views.deleta_itens_carrinho, name='deleta-itens-carrinho'), # Error
url(r'^portfolio/$', 'portfolio', name='casas-portfolio'), url(r'^portfolio/$', views.portfolio, name='casas-portfolio'),
url(r'^carteira/$', 'painel_relacionamento', name='casas-carteira'), url(r'^carteira/$', views.painel_relacionamento, name='casas-carteira'),
) ]

21
sigi/apps/convenios/urls.py

@ -1,14 +1,13 @@
# coding: utf-8 # coding: utf-8
from django.conf.urls import patterns, url from django.conf.urls import url
from sigi.apps.convenios import views
urlpatterns = patterns( urlpatterns = [
'sigi.apps.convenios.views', url(r'^convenio/reports/$', views.report, name='convenios-report'),
url(r'^convenio/carrinho/$', views.visualizar_carrinho, name='visualizar-carrinho'),
url(r'^convenio/reports/$', 'report', name='convenios-report'), url(r'^convenio/carrinho/excluir_carrinho/$', views.excluir_carrinho, name='excluir-carrinho'), # tagerror
url(r'^convenio/carrinho/$', 'visualizar_carrinho', name='visualizar-carrinho'), url(r'^convenio/carrinho/deleta_itens_carrinho$', views.deleta_itens_carrinho, name='deleta-itens-carrinho'), # tagerror
url(r'^convenio/carrinho/excluir_carrinho/$', 'excluir_carrinho', name='excluir-carrinho'), # tagerror url(r'^convenio/csv/$', views.export_csv, name='convenios-csv'),
url(r'^convenio/carrinho/deleta_itens_carrinho$', 'deleta_itens_carrinho', name='deleta-itens-carrinho'), # tagerror url(r'^reportsRegiao/(?P<regiao>\w+)/$', views.report_regiao, name='convenios-report_regiao_pdf'),
url(r'^convenio/csv/$', 'export_csv', name='convenios-csv'), ]
url(r'^reportsRegiao/(?P<regiao>\w+)/$', 'report_regiao', name='convenios-report_regiao_pdf'),
)

44
sigi/apps/diagnosticos/urls.py

@ -1,52 +1,44 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.conf.urls import patterns, url from django.conf.urls import url
from django.views.generic import TemplateView 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
urlpatterns = [
LOGIN_REDIRECT_URL = '/diagnosticos/mobile/login' url(r'^mobile/$', lista, name='lista_diagnosticos'),
urlpatterns = patterns(
'sigi.apps.diagnosticos.views',
# Lista de Diagnósticos
url(r'^mobile/$', 'lista', name='lista_diagnosticos'),
# Lista de Categorias # Lista de Categorias
url(r'^mobile/(?P<id_diagnostico>\d+)/categorias/$', url(r'^mobile/(?P<id_diagnostico>\d+)/categorias/$', categorias, name='lista_categorias'),
'categorias', name='lista_categorias'),
# Detalhes da Categoria da Casa Legislativa # Detalhes da Categoria da Casa Legislativa
url(r'^mobile/(?P<id_diagnostico>\d+)/categorias/1/$', url(r'^mobile/(?P<id_diagnostico>\d+)/categorias/1/$',
'categoria_casa_legislativa', name='detalhes_categoria_casa_legislativa'), categoria_casa_legislativa, name='detalhes_categoria_casa_legislativa'),
# Detalhes da Categoria de Contatos # Detalhes da Categoria de Contatos
url(r'^mobile/(?P<id_diagnostico>\d+)/categorias/2/$', url(r'^mobile/(?P<id_diagnostico>\d+)/categorias/2/$',
'categoria_contatos', name='detalhes_categoria_contatos'), categoria_contatos, name='detalhes_categoria_contatos'),
# Detalhes de Categorias Dinamicas # Detalhes de Categorias Dinamicas
url(r'^mobile/(?P<id_diagnostico>\d+)/categorias/(?P<id_categoria>\d+)/$', url(r'^mobile/(?P<id_diagnostico>\d+)/categorias/(?P<id_categoria>\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'^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 # Reports diagnosticos
url(r'^diagnostico/(?P<id_diagnostico>\w+).pdf$', 'diagnostico_pdf', name='diagnostico-pdf'), url(r'^diagnostico/(?P<id_diagnostico>\w+).pdf$', diagnostico_pdf, name='diagnostico-pdf'),
# Graficos de perguntas # Graficos de perguntas
url(r'^graficos/$', 'graficos', name="diagnosticos-graficos"), # tagerror url(r'^graficos/$', graficos, name="diagnosticos-graficos"), # tagerror
url(r'^api/$', 'grafico_api', name="diagnosticos-grafico-api"), # tagerror url(r'^api/$', grafico_api, name="diagnosticos-grafico-api"), # tagerror
)
urlpatterns += patterns(
'django.contrib.auth.views',
# Login do Diagnóstico # Login do Diagnóstico
url(r'^mobile/login/$', 'login', {'template_name': url(r'^mobile/login/$', login, {'template_name':
'diagnosticos/diagnosticos_login.html'}, name='login'), 'diagnosticos/diagnosticos_login.html'}, name='login'),
# Logout do Diagnóstico # Logout do Diagnóstico
url(r'^mobile/logout/$', 'logout', url(r'^mobile/logout/$', logout,
{'next_page': LOGIN_REDIRECT_URL}, name='logout'), {'next_page': LOGIN_REDIRECT_URL}, name='logout'),
) ]

3
sigi/apps/diagnosticos/views.py

@ -14,10 +14,11 @@ from sigi.apps.diagnosticos.decorators import validate_diagnostico
from sigi.apps.diagnosticos.forms import (DiagnosticoMobileForm, from sigi.apps.diagnosticos.forms import (DiagnosticoMobileForm,
CasaLegislativaMobileForm, FuncionariosMobileForm) CasaLegislativaMobileForm, FuncionariosMobileForm)
from sigi.apps.diagnosticos.models import Diagnostico, Categoria, Pergunta 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.apps.utils.decorators import login_required
from sigi.shortcuts import render_to_pdf from sigi.shortcuts import render_to_pdf
LOGIN_REDIRECT_URL = '/diagnosticos/mobile/login'
@never_cache @never_cache
@login_required(login_url=LOGIN_REDIRECT_URL) @login_required(login_url=LOGIN_REDIRECT_URL)

12
sigi/apps/eventos/urls.py

@ -1,10 +1,10 @@
# coding: utf-8 # coding: utf-8
from django.conf.urls import patterns, url from django.conf.urls import url
from sigi.apps.eventos import views
urlpatterns = patterns( urlpatterns = [
'sigi.apps.eventos.views',
# Painel de ocorrencias # Painel de ocorrencias
url(r'^calendario/$', 'calendario', name='eventos-calendario'), url(r'^calendario/$', views.calendario, name='eventos-calendario'),
url(r'^alocacaoequipe/$', 'alocacao_equipe', name='eventos-alocacaoequipe'), url(r'^alocacaoequipe/$', views.alocacao_equipe, name='eventos-alocacaoequipe'),
) ]

24
sigi/apps/home/urls.py

@ -1,15 +1,15 @@
# coding: utf-8 # 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', urlpatterns = [
url(r'^$', 'index', name='sigi_index'), url(r'^$', views.index, name='sigi_index'),
url(r'^home/resumoconvenios/$', 'resumo_convenios', name="home_resumoconvenios"), url(r'^home/resumoconvenios/$', views.resumo_convenios, name="home_resumoconvenios"),
url(r'^home/resumoseit/$', 'resumo_seit', name="home_resumoseit"), url(r'^home/resumoseit/$', views.resumo_seit, name="home_resumoseit"),
url(r'^home/chartseit/$', 'chart_seit', name="home_chartseit"), url(r'^home/chartseit/$', views.chart_seit, name="home_chartseit"),
url(r'^home/chartconvenios/$', 'chart_convenios', name="home_chartconvenios"), url(r'^home/chartconvenios/$', views.chart_convenios, name="home_chartconvenios"),
url(r'^home/chartcarteira/$', 'chart_carteira', name="home_chartcarteira"), url(r'^home/chartcarteira/$', views.chart_carteira, name="home_chartcarteira"),
url(r'^home/chartperformance/$', 'chart_performance', name="home_chartperformance"), url(r'^home/chartperformance/$', views.chart_performance, name="home_chartperformance"),
url(r'^home/report/semconvenio/$', 'report_sem_convenio', name="home_reportsemconvenio"), url(r'^home/report/semconvenio/$', views.report_sem_convenio, name="home_reportsemconvenio"),
]
)

21
sigi/apps/metas/urls.py

@ -1,14 +1,13 @@
# coding: utf-8 # coding: utf-8
from django.conf.urls import patterns, url from django.conf.urls import url
from sigi.apps.metas import views
urlpatterns = patterns( urlpatterns = [
'sigi.apps.metas.views', url(r'^$', views.dashboard, name='metas-dashboardsss'), # tagerror
url(r'^mapa/$', views.mapa, name='metas-mapa'), # tagerror
url(r'^$', 'dashboard', name='metas-dashboardsss'), # tagerror url(r'^mapdata/$', views.map_data, name='metas-map_data'),
url(r'^mapa/$', 'mapa', name='metas-mapa'), # tagerror url(r'^mapsearch/$', views.map_search, name='metas-map_search'),
url(r'^mapdata/$', 'map_data', name='metas-map_data'), url(r'^mapsum/$', views.map_sum, name='metas-map_sum'),
url(r'^mapsearch/$', 'map_search', name='metas-map_search'), url(r'^maplist/$', views.map_list, name='metas-map_list'),
url(r'^mapsum/$', 'map_sum', name='metas-map_sum'), ]
url(r'^maplist/$', 'map_list', name='metas-map_list'),
)

31
sigi/apps/ocorrencias/urls.py

@ -1,19 +1,18 @@
# coding: utf-8 # coding: utf-8
from django.conf.urls import patterns, url from django.conf.urls import url
from sigi.apps.ocorrencias import views
urlpatterns = [
urlpatterns = patterns(
'sigi.apps.ocorrencias.views',
# Painel de ocorrencias # Painel de ocorrencias
url(r'^painel/$', 'painel_ocorrencias', name='painel-ocorrencias'), url(r'^painel/$', views.painel_ocorrencias, name='painel-ocorrencias'),
url(r'^painel/buscanominal/$', 'busca_nominal', {"origin": "tudo"}, name='painel-buscanominal'), url(r'^painel/buscanominal/$', views.busca_nominal, {"origin": "tudo"}, name='painel-buscanominal'),
url(r'^painel/buscanominal/casa/$', 'busca_nominal', {"origin": "casa"}, name='painel-buscacasa'), url(r'^painel/buscanominal/casa/$', views.busca_nominal, {"origin": "casa"}, name='painel-buscacasa'),
url(r'^painel/buscanominal/servidor/$', 'busca_nominal', {"origin": "servidor"}, name='painel-buscaservidor'), url(r'^painel/buscanominal/servidor/$', views.busca_nominal, {"origin": "servidor"}, name='painel-buscaservidor'),
url(r'^painel/buscanominal/servico/$', 'busca_nominal', {"origin": "servico"}, name='painel-buscaservico'), url(r'^painel/buscanominal/servico/$', views.busca_nominal, {"origin": "servico"}, name='painel-buscaservico'),
url(r'^mudaprioridade/$', 'muda_prioridade', name='ocorrencia-mudaprioridade'), url(r'^mudaprioridade/$', views.muda_prioridade, name='ocorrencia-mudaprioridade'),
url(r'^excluianexo/$', 'exclui_anexo', name='ocorrencia-excluianexo'), url(r'^excluianexo/$', views.exclui_anexo, name='ocorrencia-excluianexo'),
url(r'^incluianexo/$', 'inclui_anexo', name='ocorrencia-incluianexo'), url(r'^incluianexo/$', views.inclui_anexo, name='ocorrencia-incluianexo'),
url(r'^anexosnippet/$', 'anexo_snippet', name='ocorrencia-anexosnippet'), url(r'^anexosnippet/$', views.anexo_snippet, name='ocorrencia-anexosnippet'),
url(r'^incluicomentario/$', 'inclui_comentario', name='ocorrencia-incluicomentario'), url(r'^incluicomentario/$', views.inclui_comentario, name='ocorrencia-incluicomentario'),
url(r'^incluiocorrencia/$', 'inclui_ocorrencia', name='ocorrencia-incluiocorrencia'), url(r'^incluiocorrencia/$', views.inclui_ocorrencia, name='ocorrencia-incluiocorrencia'),
) ]

18
sigi/apps/parlamentares/urls.py

@ -1,17 +1,17 @@
# coding: utf-8 # coding: utf-8
from django.conf.urls import patterns, url from django.conf.urls import url
from sigi.apps.parlamentares import views
urlpatterns = patterns( urlpatterns = [
'sigi.apps.parlamentares.views',
# Reports labels parlamentares # Reports labels parlamentares
url(r'^parlamentar/labels/$', 'labels_report', name='labels-report-all'), url(r'^parlamentar/labels/$', views.labels_report, name='labels-report-all'),
url(r'^parlamentar/(?P<id>\w+)/labels/$', 'labels_report', name='labels-report-id'), url(r'^parlamentar/(?P<id>\w+)/labels/$', views.labels_report, name='labels-report-id'),
# Carrinho # Carrinho
url(r'^parlamentar/carrinho/$', 'visualizar_carrinho', name='visualizar-carrinho'), url(r'^parlamentar/carrinho/$', views.visualizar_carrinho, name='visualizar-carrinho'),
url(r'^parlamentar/carrinho/deleta_itens_carrinho$', 'deleta_itens_carrinho', name='deleta-itens-carrinho'), url(r'^parlamentar/carrinho/deleta_itens_carrinho$', views.deleta_itens_carrinho, name='deleta-itens-carrinho'),
# A view excluir_carrinho n existe ainda. # 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'),
) ]

11
sigi/apps/saberes/urls.py

@ -1,14 +1,11 @@
# coding: utf-8 # 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-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/cursos-com-turoria/?$', cursos_com_tutoria, name="saberes-cursos-com-tutoria"),
url(r'^dashboard/?$', dashboard, name="saberes-dashboard-view"), url(r'^dashboard/?$', dashboard, name="saberes-dashboard-view"),
url(r'^(?P<path>(plugin|api)/.*)$', pentaho_proxy), url(r'^(?P<path>(plugin|api)/.*)$', pentaho_proxy),
) ]

23
sigi/apps/servicos/urls.py

@ -1,15 +1,10 @@
# coding: utf-8 # coding: utf-8
from django.conf.urls import patterns, url from django.conf.urls import url
from django.views.generic.base import TemplateView from sigi.apps.servicos import views
from .views import MapaView urlpatterns = [
url(r'^manifesta/$', views.casa_manifesta_view, name="casa-manifesta-view"),
url(r'^munatenjson/(?P<servico>\w+)/$', views.municipios_atendidos, name="municipios-atendidos"),
urlpatterns = patterns( url(r'^mapa/(?P<servico>\w+)/$', views.MapaView.as_view(), name="servicos-mapa"),
'sigi.apps.servicos.views', # url(r'^listacasas/(?P<sigla>\w+)', views.casas_usam_servico, name="casas-usam-servico"),
]
url(r'^manifesta/$', 'casa_manifesta_view', name="casa-manifesta-view"),
url(r'^munatenjson/(?P<servico>\w+)/$', 'municipios_atendidos', name="municipios-atendidos"),
url(r'^mapa/(?P<servico>\w+)/$', MapaView.as_view(), name="servicos-mapa"),
# url(r'^listacasas/(?P<sigla>\w+)', 'casas_usam_servico', name="casas-usam-servico"),
)

15
sigi/apps/servidores/urls.py

@ -1,11 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.conf.urls import patterns, url from django.conf.urls import url
from sigi.apps.servidores import views
urlpatterns = [
urlpatterns = patterns( url(r'^servidores_por_funcao.pdf$', views.servidores_por_funcao, name='servidores-funcao-pdf'),
'sigi.apps.servidores.views', url(r'^servidores_por_cargo.pdf$', views.servidores_por_cargo, name='servidores-cargo-pdf'),
]
# 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'),
)

17
sigi/urls.py

@ -1,6 +1,6 @@
#-*- coding:utf-8 -*- #-*- coding:utf-8 -*-
from django.conf import settings 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.conf.urls.static import static
from django.contrib import admin from django.contrib import admin
from django.views.generic.base import TemplateView 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.site.index_template = 'index.html'
admin.autodiscover() admin.autodiscover()
urlpatterns = patterns( urlpatterns = [
'',
url(r'^parlamentares/', include('sigi.apps.parlamentares.urls')), url(r'^parlamentares/', include('sigi.apps.parlamentares.urls')),
url(r'^casas/', include('sigi.apps.casas.urls')), url(r'^casas/', include('sigi.apps.casas.urls')),
url(r'^convenios/', include('sigi.apps.convenios.urls')), url(r'^convenios/', include('sigi.apps.convenios.urls')),
@ -32,15 +30,14 @@ urlpatterns = patterns(
# Suspended # Suspended
#url(r'^i18n/', include('django.conf.urls.i18n')), #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: if settings.DEBUG:
urlpatterns = patterns( from django.views.static import serve
'', urlpatterns = [
url(r'^404/$', TemplateView.as_view(template_name='404.html')), url(r'^404/$', TemplateView.as_view(template_name='404.html')),
url(r'^500/$', TemplateView.as_view(template_name='500.html')), url(r'^500/$', TemplateView.as_view(template_name='500.html')),
url(r'^503/$', TemplateView.as_view(template_name='503.html')), url(r'^503/$', TemplateView.as_view(template_name='503.html')),
url(r'^media/(?P<path>.*)$', 'django.views.static.serve', { url(r'^media/(?P<path>.*)$', serve, {
'document_root': settings.MEDIA_ROOT, }), 'document_root': settings.MEDIA_ROOT, }),
) + urlpatterns ] + urlpatterns

Loading…
Cancel
Save