Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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}), 
]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #django #serve #media #folder
ADD COMMENT
Topic
Name
1+1 =