Skip to content

Commit

Permalink
#221 - Correcting collecting static files when debug is false
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopaulonsoares committed Dec 3, 2017
1 parent 25faf23 commit 9e00073
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ python3 medical_prescription/manage.py makemigrations
python3 medical_prescription/manage.py migrate
echo "Load all datas"
python3 medical_prescription/manage.py loaddata data2.json
echo "Collecting static"
python3 medical_prescription/manage.py collectstatic
echo "Run server"
python3 medical_prescription/manage.py runserver 0.0.0.0:8000 & .
./node_modules/.bin/gulp default
9 changes: 5 additions & 4 deletions medical_prescription/medical_prescription/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def protected_serve(request, path, document_root=None, show_indexes=False):
url(r'^$', home, name='landing_page'),
)

if settings.DEBUG:
urlpatterns += [
url(r'^', TemplateResponse, {'template': 'erro404.html'}),
]
# if settings.DEBUG:
# urlpatterns += [
# (r'^media/(?P<path>.*)$', 'django.views.static.serve',
# {'document_root': settings.MEDIA_ROOT, 'show_indexes': True,})
# ]
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@
<div class="logo">
<p>OOPS! - A página que você procura não foi encontrada ;(</p>
<img src="{% static 'error/404.png' %}"/>
<!-- <img src="error/404.png"/> -->
<h2> Verifique se a url foi digitada corretamente e tente novamente!</h2>
<div class="sub">
<p><a href="{% url 'landing_page'%}">Voltar a página inicial </a></p>
Expand Down

0 comments on commit 9e00073

Please sign in to comment.