STATIC_URL = '/static/' STATIC_ROOT = 'static' ## 新增行 STATICFILES_DIRS = (os.path.join(base_DIR, '/static/'),)2.修改url.py文件
from django.views import static ##新增 from django.conf import settings ##新增 from django.conf.urls import url ##新增 urlpatterns = [ ## 以下是新增 url(r'^static/(?P修改之后就可以啦.*)$', static.serve, {'document_root': settings.STATIC_ROOT}, name='static'), ]
参考 https://blog.csdn.net/qq_36874480/article/details/100652364



