From f18089e227f15adc2effc64aae572eae66d19c1a Mon Sep 17 00:00:00 2001 From: LeandroRoberto Date: Fri, 17 Jun 2016 23:33:59 -0300 Subject: [PATCH] Move url media para sapl.urls --- sapl/base/urls.py | 4 ---- sapl/sessao/urls.py | 4 ---- sapl/urls.py | 3 +++ 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/sapl/base/urls.py b/sapl/base/urls.py index 94cd3979a..13b9d7eb2 100644 --- a/sapl/base/urls.py +++ b/sapl/base/urls.py @@ -23,7 +23,3 @@ urlpatterns = [ name='login'), url(r'^logout/$', views.logout, {'next_page': '/login'}, name='logout') ] - -# Fix a static asset finding error on Django 1.9 + gunicorn: -# http://stackoverflow.com/questions/35510373/ -urlpatterns += staticfiles_urlpatterns() diff --git a/sapl/sessao/urls.py b/sapl/sessao/urls.py index f616e00a2..ef1a4c7be 100644 --- a/sapl/sessao/urls.py +++ b/sapl/sessao/urls.py @@ -1,7 +1,5 @@ from django.conf.urls import include, url -from django.views.static import serve -from sapl import settings from sapl.sessao.views import (BancadaCrud, CargoBancadaCrud, EditMateriaOrdemDiaView, ExpedienteMateriaCrud, ExpedienteView, ListMateriaOrdemDiaView, @@ -40,8 +38,6 @@ urlpatterns = [ url(r'^(?P\d+)/reordenar-expediente$', reordernar_materias_expediente, name="reordenar_expediente"), - url(r'^media/(?P.*)$', serve, - {'document_root': settings.MEDIA_ROOT}), url(r'^rest/', include(sessao_rest)), url(r'^sistema/sessao-plenaria/tipo/', include(TipoSessaoCrud.get_urls())), diff --git a/sapl/urls.py b/sapl/urls.py index 2fb1df919..750cce94d 100644 --- a/sapl/urls.py +++ b/sapl/urls.py @@ -53,6 +53,9 @@ urlpatterns = [ ] +# Fix a static asset finding error on Django 1.9 + gunicorn: +# http://stackoverflow.com/questions/35510373/ + if settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)