dkoug Blog

Django url settings for staticfiles and media

Django -- Posted on July 17, 2017

1
2
3
4
5
6
7
8
from django.conf import settings
from django.conf.urls.static import static

if settings.DEBUG:
    urlpatterns += static(
        settings.STATIC_URL, document_root=settings.STATIC_ROOT)
    urlpatterns += static(
        settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)