Answers for "django serve media folder"

0

django serve media folder

# FOR DEBUG ONLY!!!
from django.urls import re_path
from django.views.static import serve

urlpatterns = [
    ...
    re_path(r'^media/(?P<path>.*)$', serve,{'document_root': settings.MEDIA_ROOT}), 
]
Posted by: Guest on August-01-2021

Python Answers by Framework

Browse Popular Code Answers by Language