[Answered ]-Django. Serving staticfiles with DEBUG=false on local

1👍

Changed my root urls.py to:

from django.conf import settings
from django.views.static import serve

urlpatterns += [
    re_path(r'^media/(?P<path>.*)$', serve,{'document_root': settings.MEDIA_ROOT}),
    re_path(r'^static/(?P<path>.*)$', serve,{'document_root': settings.STATIC_ROOT})
]
👤Docker

Leave a comment