django加载静态文件

1.setting.py
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, "staticDirectory"),
)
2.html
{% load static %}
<link rel="stylesheet" type="text/css" href="{%static 'css/x.css'%}"/>

posted @ 2019-08-30 19:28  赵钱富贵  阅读(205)  评论(0编辑  收藏  举报