Django templates crashes with no sense
- by user233323
Hello I'm trying to use google visualization API along with django templates system. I got an error that don't know how to fix. The error is the following:
invalid_block_tag
raise self.error(token, "Invalid block tag: '%s'" % command)
django.template.TemplateSyntaxError: Invalid block tag: 'endfor'
The code is:
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('date', 'time');
data.addColumn('number', 'x');
data.addColumn('number', 'y');
data.addColumn('number', 'z');
data.addRows([
{% for d in datos &}
[new Date({{d.instante|date:"Y, m, d, H, i, s"}}), {{d.x}}, {{d.y}}, {{d.z}}]
{% if not forloop.last %},{% endif %}
]);
{% endfor %}
var chart = new google.visualization.AnnotatedTimeLine(document.getElementById('chart_div'));
chart.draw(data, {displayAnnotations: true});
}
Thanks you all!