title: Python Flask loop FOR in Java Script
body: <p>I need to add to the array Java Script informations from Python list</p>
  
  <p><strong>list.py</strong></p>
  
  <pre><code>workflows = [{"date": '2012', "rate": 5}, {"date": '2011', "rate": 4}]
  return render_template('modules/general/backoffice/rating.html',  workflows=workflows)
  </code></pre>
  
  <p><strong>rating.html</strong></p>
  
  <pre><code>{% block module_scripts %}
      &lt;script&gt;
              $(function () {
                  "use strict";
                  // LINE CHART
                  var line = new Morris.Line({
                      element: 'line-chart',
                      resize: true,
                      data: [
                          {% for workflow in workflows %}
                              {time: {{ workflow.date }}, rate: {{workflow.rate}} }
                          {% endfor %}
                      ],
                      xkey: 'time',
                      ykeys: ['rate'],
                      labels: ['Rate'],
                      lineColors: ['#3c8dbc'],
                      hideHover: 'auto'
                  });
              });
          &lt;/script&gt;
  {% endblock %}
  </code></pre>
  
  <p>But it does not work.</p>
  
  <p>I've seen a lot of posts about my problem, but they are not suitable.</p>
  
  <p>One of them <a href="https://stackoverflow.com/questions/11333824/django-for-loop-in-javascript">Django FOR LOOP in JavaScript</a></p>