访问 Django 项目的静态资源

 

from django.urls import path, re_path

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

 

re_path(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}),

posted @ 2019-10-08 15:14  赵伟航  阅读(606)  评论(0编辑  收藏  举报