title: Jinja2 If Statement
body: <p>The code below is a sample form I'm using to learn jinja2.  As written, it returns an error saying that it doesn't recognize the {% endif %} tag.  Why does this happen?</p>
  
  <pre><code>&lt;html&gt;
  
  Name: {{ name }}
  Print {{ num }} times
  Color: {{ color }}
  {% if convert_to_upper %}Case: Upper
  {% elif not convert_to_upper %}Case: Lower{% endif %}
  
  
  
  
  {% for repeats in range(0,num) %}
  {% if convert_to_upper %}
  {% filter upper %}
  {% endif %}
  &lt;li&gt;&lt;p style="color:{{ color }}"&gt;{{ name }}&lt;/style&gt;&lt;/li&gt;
  {% endfilter %}
  {% endfor %}
  &lt;/html&gt;
  </code></pre>