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'%}"/>
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'%}"/>