title: How to simulate while loop in Jinja2
body: <p>How would I do the following in jinja2:</p>
  
  <pre><code>while apples &lt; oranges:
      # some work here.
  </code></pre>
  
  <p>According to <a href="http://jinja.pocoo.org/docs/dev/extensions/#loop-controls" rel="nofollow noreferrer">http://jinja.pocoo.org/docs/dev/extensions/#loop-controls</a>, and by the error I am getting, Jinja2 does not support while loops.</p>
  
  <p>The question is I want to continuously do some work as long as the value of <code>apples</code> is less than that of <code>oranges</code></p>
  
  <p>Thanks for any help.</p>
  
  <p>Also something equivalent to <code>while True:</code> is good also.</p>