📜  django 服务媒体文件夹 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:42.432000             🧑  作者: Mango

代码示例1
# FOR DEBUG ONLY!!!
from django.urls import re_path
from django.views.static import serve

urlpatterns = [
    ...
    re_path(r'^media/(?P.*)$', serve,{'document_root': settings.MEDIA_ROOT}), 
]