Django:TypeError: view must be a callable or a list/tuple in the case of include().

错误:

path("uploads/(?P<path>.*)$", 'django.views.static.serve', {"document_root": settings.MEDIA_ROOT}),

修改为:

from django.views.static import serve
path("uploads/(?P<path>.*)$", serve, {"document_root": settings.MEDIA_ROOT})

 

 

 

参考链接:https://www.cnblogs.com/fwl8888/p/9357494.html

path
posted @ 2020-12-16 19:44  胸怀丶若谷  阅读(256)  评论(0编辑  收藏  举报