我已经有一段时间遇到这个问题了,我试图用Django创建一个网站,而且我已经开始使用bootstrap了。问题是我的自定义CSS有时只加载。这意味着当我对代码进行更改时,更改不会总是反映在页面上。然后我会离开我的电脑,几个小时后再回来,改变就在那里。这是我的代码:
{% load staticfiles %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>DUFC Sign-In</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<!--<link rel="stylesheet" href="{% static 'css/bootstrap-theme.css' %}">-->
<link rel="stylesheet" href="{% static 'css/bootstrap-override.css' %}">
<script src="{% static 'js/bootstrap.min.js' %}"></script>
</head>
<nav class="navbar navbar-default" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">DUFC</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="{% url 'sign_in' %}">click</a></li>
<li><a href="#">Link</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Clients<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="{% url 'client_roster' %}">My Roster</a></li>
<li><a href="#">My Profile</a></li>
<li><a href="#">My Account</a></li>
<!--<li><a href="#">Separated link</a></li> -->
<!--<li><a href="#">One more separated link</a></li>-->
</ul>
</li>
</ul>
<form class="navbar-form navbar-left" role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search Clients">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li><a href="#">Sign Out</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">ADMIN <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Weekly Scheduler</a></li>
<li><a href="#">Client Workouts</a></li>
<li><a href="#">My Availibility</a></li>
<!-- <li><a href="#">Separated link</a></li> -->
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</nav><div class="container"></div>
对于Bootstrap,我一直在摆弄标签中应该加载的内容。这似乎没有改变任何东西,这可能是浏览器的问题吗?与缓存有关吗?