方法一:
1.建立一个static文件存放各种效果文件
2.在setting设置加载路径
STATICFILES_DIRS=(
os.path.join(BASE_DIR,"static"),
)
3.设置别名,方便后期修改
STATIC_URL = '/static/'
方法二:
{% load staticfiles %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
{% load staticfiles %}
<title>Title</title>
</head>
<body>
<script src="{% static 'jquery-3.3.1.min.js' %}" ></script>
<p>hello {
{time}}</p>
<script>
$("p").css("color","red");
</script>
</body>
</html>
部署路由
from