Tab showing on homepage which shouldnt show
<p>This is my base.html file:</p>

<pre><code>{% load staticfiles %}

&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;link rel="stylesheet" href="{% static 'css/css/bootstrap.css' %}"&gt;
&lt;link rel="stylesheet" href="{% static 'css/css/bootstrap-theme.css' %}"&gt;
&lt;/head&gt;
&lt;/html&gt;

&lt;body&gt;
&lt;nav class="navbar navbar-default"&gt;&lt;/nav&gt;
&lt;nav class="navbar navbar-inverse navbar-fixed-top"&gt;
  &lt;div class="container"&gt;
    &lt;div class="navbar-header"&gt;
      &lt;button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"&gt;
        &lt;span class="sr-only"&gt;Toggle navigation&lt;/span&gt;
        &lt;span class="icon-bar"&gt;&lt;/span&gt;
        &lt;span class="icon-bar"&gt;&lt;/span&gt;
        &lt;span class="icon-bar"&gt;&lt;/span&gt;
      &lt;/button&gt;
    &lt;/div&gt;
    &lt;div id="navbar" class="navbar-collapse collapse"&gt;
        &lt;ul class="nav navbar-nav"&gt;
            &lt;li class="active"&gt;&lt;a href="/"&gt;Home&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="/fitbit/"&gt;Fitbit&lt;/a&gt;&lt;/li&gt;
            {% if user.is_anonymous %}
            {% else %}
            &lt;li&gt;&lt;a href="/logout/"&gt;Log Out&lt;/a&gt;&lt;/li&gt;
            {% endif %}      
    &lt;/div&gt;&lt;!--/.navbar-collapse --&gt;
  &lt;/div&gt;
&lt;/nav&gt;
&lt;center&gt;

{% block content %}{% endblock %}
&lt;/center&gt; 

&lt;!-- Bootstrap core JavaScript
================================================== --&gt;
&lt;!-- Placed at the end of the document so the pages load faster --&gt;
&lt;script  src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"&gt;&lt;/script&gt;
&lt;script&gt;window.jQuery || document.write('&lt;script src="css/js/jquery.min.js"&gt; &lt;\/script&gt;')&lt;/script&gt;
&lt;script src="/static/css/js/bootstrap.min.js"&gt;&lt;/script&gt;
&lt;script src="/static/css/js/bootstrap.js"&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;footer&gt;
&lt;p&gt;&amp;copy; 2016 Hanze Hogeschool Groningen&lt;/p&gt;
&lt;/footer&gt;
</code></pre>

<p>As you can see I'm doing a check if the user is anonymous if he is not anonymous it should show the log out button. But at the moment when I return to the homepage it still shows the Log Out button. </p>

<p>My question is, how do I make it so that the log out will not show on the homepage. According to my own thinking I think django still thinks I'm not anonymous on the homepage.</p>

<p>And this is the image for the problem:
<a href="http://i.stack.imgur.com/J34SS.png" rel="nofollow">homepage</a></p>