0
点赞
收藏
分享

微信扫一扫

django基于python 语言的酒店推荐系统

存在问题:
如何引用添加的静态文件;


解决方案:

  1. 首先app应用下建立static静态文件路径,然后static中分别建立css、fonts和css文件夹,并将其相应的文件放到各自对应目录下;
  2. 页面引用
#HTML顶部引入static,<head>中引入css和fonts,<body>中引入js
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="{% static 'css/bootstrap.css' %}">
    <link rel="stylesheet" href="{% static 'fonts/glyphicons-halflings-regular.woff' %}">
</head>
<body>
    <script src="{% static 'js/jquery-3.1.1.min.js' %}"></script>
    <script src="{% static 'js/bootstrap.min.js' %}"></script>
</body>
举报

相关推荐

0 条评论