title: How can I iterate over my list in jinja2 flask app?
body: <p>I have the following code:</p>
  <pre><code>{% extends &quot;base.html&quot; %}
  
  {% block app_content %}
  
      &lt;table class=&quot;table table-hover table-striped&quot;&gt;
  
          &lt;thead&gt;
          &lt;tr&gt;
              &lt;th style=&quot;text-align: center&quot;&gt;Hostname&lt;/th&gt;
              &lt;th style=&quot;text-align: center&quot;&gt;IP_address&lt;/th&gt;
              &lt;th style=&quot;text-align: center&quot;&gt;uptime&lt;/th&gt;
              &lt;th style=&quot;text-align: center&quot;&gt;location&lt;/th&gt;
          &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
              &lt;ul&gt;
              {% for canary in newlist %}
                &lt;li&gt;{{ canary }}&lt;/li&gt;
              {% endfor %}
              &lt;/ul&gt;
              
  
          &lt;/tbody&gt;
      &lt;/table&gt;
  
  {% endblock %}
  </code></pre>
  <p>How do i make it so that each of my appended items from my python file are under each separate column?</p>
  <p>Currently it just lists my list.</p>
  <p>This is my return function</p>
  <pre><code>def canaries_up_time(results):
  
      results = results.json()
      #print(json.dumps(my_dict, indent=3))
      newlist = []
      for item in results['devices']:
          
          newlist.append(item.get(&quot;name&quot;))
          newlist.append(item.get(&quot;uptime&quot;))
          newlist.append(item.get(&quot;ip_address&quot;))
          newlist.append(item.get(&quot;location&quot;))
  
      return newlist
  </code></pre>