参考:https://docs.djangoproject.com/en/dev/howto/static-files/

settings:

# 配置静态文件路径static

STATIC_URL = '/static/'

 html:

# 1、加载静态文件static路径

{% load static %}


<!DOCTYPE html>
<html>
<head>
<title>{% block title %}{% endblock %}</title>

# 2、导入样式
<link href="{% static "css/base.css" %}" rel="stylesheet">


</head>

 

 posted on 2019-12-30 22:32  墨语i  阅读(88)  评论(0)    收藏  举报