1.setting.py
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, "static"),
)
2.html
{% load static %}
<link rel="stylesheet" type="text/css" href="{% static 'css/x.css'%}"/>
转载于:https://www.cnblogs.com/mznsndy/p/11436746.html