0

I've been having this problem for a while, I'm trying to make a website with Django, and I've started using bootstrap. The problem is that my custom CSS only loads sometimes. Meaning when I make a change to the code, the changes won't always be reflected on the page. Then I'll leave my computer, come back a few hours later and the changes will be there. Here's my code:

{% 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>

I've been fiddling around with what I should load in the tag, in regards to Bootstrap. That doesn't seem to change anything, could it be a problem with the browser? Something to do with the cache?

Amon
  • 2,725
  • 5
  • 30
  • 52
  • 1
    you can try `ctrl + f5` if you are using chrome – Shift 'n Tab Jan 26 '17 at 04:49
  • omg that worked, thank you so much. You have no idea how long this has been bothering me. Why is there not more info on this? This seems like an issue most people would have – Amon Jan 26 '17 at 04:51
  • 1
    yea most people had that problem, if you want to clear the cache in your web application just do that, you can take a loot at this http://stackoverflow.com/questions/385367/what-requests-do-browsers-f5-and-ctrl-f5-refreshes-generate – Shift 'n Tab Jan 26 '17 at 04:52
  • thanks a lot, I wouldve given you best answer for that! – Amon Jan 26 '17 at 05:00
  • 1
    but there could be one problem here, in django developement you CANT easily clear cache by that method. you can visit here instead http://stackoverflow.com/questions/7013735/turn-off-caching-of-static-files-in-django-development-server – Shift 'n Tab Jan 26 '17 at 05:08
  • thank you for this again – Amon Jan 27 '17 at 03:09

0 Answers0