Django-1.11.29
simpleui-4.0.2
原因是在线调用css js失效
替换调用本地静态文件
方法1: 替换成其他的cdn源
vim /usr/local/python/python2.7.9/lib/python2.7/site-packages/simpleui/templates/admin/includes/js-part.html
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/index.js"></script>
vim /usr/local/python/python2.7.9/lib/python2.7/site-packages/simpleui/templates/admin/includes/css-part.html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/theme-chalk/index.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.13.0/css/all.min.css">
方法2:替换调用本地静态文件
vim /usr/local/python/python2.7.9/lib/python2.7/site-packages/simpleui/templates/admin/includes/js-part.html
<script type="text/javascript" src="{% static '/admin/simpleui-x/js/vue.min.js' %}"></script>
<script type="text/javascript" src="{% static '/admin/simpleui-x/elementui/index.js' %}"></script>
vim /usr/local/python/python2.7.9/lib/python2.7/site-packages/simpleui/templates/admin/includes/css-part.html
<link rel="stylesheet" href="{% static '/admin/simpleui-x/elementui/theme-chalk/index.css' %}">
<link rel="stylesheet" href="{% static '/admin/simpleui-x/fontawesome-free-5.8.1-web/css/all.min.css' %}">
nginx 配置文件中配置本地静态文件路径
location /static {
# Django项目静态文件的路径
alias /opt/platform/static;
}
网友评论