django部署后样式加载不出来解决方案

django部署后样式加载不出来
1.html文件去掉<!DOCTYPE html>
2. location /static {
alias /home/static/;
}
3.STATIC_ROOT="/home/static/"
4、根目录:from PROJECT import settings
from django.views.static import serve
url(r'^static/(?P<path>.*)$', serve,
{'document_root': settings.STATIC_ROOT}, name='static')

posted @ 2019-06-25 13:01  北漂的雷子  阅读(2691)  评论(0编辑  收藏  举报