Updating Jinja2 Variables every X seconds - Python Flask
<p>I am trying to update variables inside of my index.html file. I am going to be running a thread with a loop in python but I want a way to update my jinja2 table listed below to update every x seconds just like if you were using php and ajax.</p>

<p>Here is my Jinja2 Code: </p>

<pre><code>&lt;table border=1 id="allTable" class="display"&gt;
        &lt;tbody id="eliteTable"&gt;
        &lt;tr&gt;&lt;td colspan=9 class=queueheader&gt;Elite  (Current SLA: {{ eliteSLA | safe}}%)&lt;/td&gt;&lt;/tr&gt;
        &lt;tr&gt;&lt;th&gt;Skill&lt;/th&gt;&lt;th&gt;SLA&lt;/th&gt;&lt;th&gt;Calls Waiting&lt;/th&gt;&lt;th&gt;Hold Time&lt;/th&gt;&lt;th&gt;Staffed&lt;/th&gt;&lt;th&gt;Avail&lt;/th&gt;&lt;th&gt;ACW&lt;/th&gt;&lt;th&gt;Aux&lt;/th&gt;&lt;th&gt;ACD Calls&lt;/th&gt;&lt;/tr&gt;
        {% for row in eliteList %}
            {% if row[2]|int &gt; 30 %}
                &lt;tr class=longwait&gt;
            {% elif row[2]|int &gt; 0 %}
                &lt;tr class=waiting&gt;
            {% else %}
                &lt;tr&gt;
            {% endif %}
            {% for i in row %}
                &lt;td&gt; {{ i | safe }} &lt;/td&gt;
            {% endfor %}
            &lt;/tr&gt;
        {% endfor %}
        &lt;/tbody&gt;

    &lt;/table&gt;
</code></pre>

<p>Jinja variables are generated at template render-time. There's no way to programmatically update them without using javascript of some sort.</p>

<p>From <a href="http://jinja.pocoo.org/docs/dev/templates/" rel="nofollow">the docs</a> (emphasis mine):</p>

<blockquote>
  <p>A [Jinja] template contains variables and/or expressions, <strong>which get replaced with values when a template is rendered</strong>; and tags, which control the logic of the template. The template syntax is heavily inspired by Django and Python.</p>
</blockquote>

python html flask jinja2