title: flask : encountered unknown tag endif though tags were specified
body: <p>I'm working on a flask-sqlalchemy webapp that requires login.
  The logout button should be visible on the pages only if user is logged in.
  So all those pages extend layout.html file which looks like this:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  
  
  
  &lt;head&gt;
  
      &lt;meta charset="utf-8"&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
      &lt;meta name="description" content=""&gt;
      &lt;meta name="author" content=""&gt;
  
      &lt;title&gt;Login&lt;/title&gt;
  
      &lt;link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet"&gt;
      {% block head %} {% endblock %} 
  
  &lt;/head&gt;
  
  &lt;body&gt;
  {% block body %}
  &lt;style type="text/css"&gt;
    #footer {
      position : absolute;
      bottom : 0;
    }
  &lt;/style&gt;
  { % if session['logged_in'] %}
  
  &lt;div id="footer" style="width:300px;height:100px"&gt;&lt;a href="   {{url_for('logout')}}" style="width:100%;background:#f1f1f1;"&gt;Logout&lt;/a&gt;&lt;/div&gt;
  
  {% endif %}
  
  {% endblock %}
  
  
      &lt;script src="{{ url_for('static', filename='js/jquery.js') }}"&gt;&lt;/script&gt;
      &lt;script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"&gt;&lt;/script&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>The error I'm getting is :</p>
  
  <blockquote>
    <p>TemplateSyntaxError: Encountered unknown tag 'endif'. Jinja was
    looking for the following tags: 'endblock'.</p>
  </blockquote>
  
  <p>The innermost block that needs to be closed is 'block'.</p>
  
  <p>Although the endblock and if tags have been specified
  Please help me fix this</p>