title: django template if return True even if variable False
body: <p>I am beginner in django and most probably i do something wrong.</p>
  <p>My view :</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>class StartPageIndexView(View):
      def get(self, request):
          form = UserLoginRegistrationForm()
          lorem_ipsum_text = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
  
          print("request.user %s", request.user)
          is_logged_on = False
          if request.user.is_authenticated:
              logger.error("User authenticated")
              is_logged_on = True
  
          context = {
              'lorem_ipsum': lorem_ipsum_text,
              'registration_form': form,
              'is_logged_on': is_logged_on,
          }
          return render(request, 'startpage/index.html', context=context)</code></pre>
  </div>
  </div>
  </p>
  <p>my template :</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>{% extends "base.html" %}
  {% if is_logged_on is True %}
      {% block sidebar %}
          {{ is_logged_on }}
          {% include "inc/_sidebar.html" %}
      {% endblock %}
  {% endif %}
  {% block content %}
      {{ is_logged_on }}
      {{ lorem_ipsum }}
  {% endblock %}</code></pre>
  </div>
  </div>
  
  In browser i see this . Can you please tell me what i do wrong ?</p>
  <p><a href="https://i.stack.imgur.com/NadwK.png" rel="nofollow noreferrer">Screenshot</a></p>