title: Passing data to Google Charts with Django
body: <p>This question has been asked but not answered like this <a href="https://stackoverflow.com/questions/17723648/django-with-google-charts">one</a>.</p>
  <p>In my <code>view.py</code> I have data pulled from MySQL, example of the array:</p>
  <pre><code>(Decimal('13'), Decimal('6'), Decimal('13'))
  (Decimal('207'), Decimal('18'), Decimal('129'))
  (Decimal('301'), Decimal('38'), Decimal('193'))
  (Decimal('204'), Decimal('32'), Decimal('150'))
  (Decimal('159'), Decimal('25'), Decimal('88'))
  
  args = {'array':array}
  return render_to_response('page2.html', args)
  </code></pre>
  <p>Trying to put it into Google Chart</p>
  <pre><code>function drawChart() {
      var djangoData = JSON.parse('{{ args }}');
      var data = google.visualization.arrayToDataTable(djangoData);
  </code></pre>
  <p>Also tried <code>var djangoData = {{ array }};</code>
  Both with no luck!</p>
  <h2>Edit1</h2>
  <p>Suggested</p>
  <pre><code>return render_to_response('page2.html', {'array': json.dumps(array)})
  </code></pre>
  <p>Looks like it would work, except that the db produces incompatible type. Is there a way to do this without converting every item to <code>int</code> type. Or if there if there is a pythonic way to convert it?</p>
  <h2>Edit - Solution</h2>
  <p>Use selected answer and add <code>|safe</code> to array, so <code>{{array|safe}}</code></p>