{% load staticfiles %}
<link rel="stylesheet" type="text/css" href="{% static 'music/style.css' %}" >
<link rel="stylesheet" href="{{ STATIC_URL }}css/bootstrap.min.css">
<script src="{{ STATIC_URL }}js/jquery-1.12.3.min.js"></script>
<script src="{{ STATIC_URL }}js/bootstrap.min.js"></script>
<nav class="navbar-default">
<div class="container fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="stopNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{% url 'music:index' %}">Go praT!</a>
</div>
</div>
</nav>
使用静态URL时,导航栏未显示。 当我使用以下行来包含脚本时,一切正常。
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>