aboutsummaryrefslogtreecommitdiff
path: root/cheat/.cheat/django
diff options
context:
space:
mode:
Diffstat (limited to 'cheat/.cheat/django')
-rw-r--r--cheat/.cheat/django19
1 files changed, 19 insertions, 0 deletions
diff --git a/cheat/.cheat/django b/cheat/.cheat/django
index ebb5817..97efafc 100644
--- a/cheat/.cheat/django
+++ b/cheat/.cheat/django
@@ -29,3 +29,22 @@ django-admin makemessages -l fr
# compil translations files
django-admin compilemessages
+
+# Pour tester avec debug=False et manage.py runserver
+source : https://stackoverflow.com/a/49722734
+
+In urls.py I added this line:
+
+```
+from django.views.static import serve
+```
+
+add those two urls in urlpatterns:
+
+```
+url(r'^media/(?P<path>.*)$', serve,{'document_root': settings.MEDIA_ROOT}),
+url(r'^static/(?P<path>.*)$', serve,{'document_root': settings.STATIC_ROOT}),
+```
+
+and both static and media files were accesible when DEBUG=FALSE.
+Hope it helps :)