so im using the following java script

var cpuChart = document.getElementById('cpu').getContext('2d');
        new Chart(cpuChart).Line(cpuData,{
        bezierCurve: false,
        datasetFill : false,
        legendTemplate : "<ul class=\"<%=name.toLowerCase()%>-legend\"><% 
for (var i=0; i<datasets.length; i++){%><li><span 
style=\"background-color:<%=datasets[i].lineColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>"
        
        });

django will see the % signs and think it is block content as it says below 
i copy and pasted the error, how i get django to ignore a section of my 
code and not parse the tags for that section.


Request Method:POSTRequest URL:http://127.0.0.1:8000/vmstats/Django Version:
1.6.5Exception Type:TemplateSyntaxErrorException Value:

Invalid block tag: '><li><span'

Exception 
Location:/usr/local/lib/python2.7/dist-packages/django/template/base.py 
in invalid_block_tag, line 332Python Executable:/usr/bin/pythonPython 
Version:2.7.5Python Path:

['/home/grant/workspace/Django Projects/trunk/holon',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PILcompat',
 '/usr/lib/python2.7/dist-packages/gtk-2.0',
 '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
 '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']

Server time:Wed, 30 Jul 2014 23:27:32 +0000
Error during template rendering

In template /home/grant/workspace/Django 
Projects/trunk/holon/portal/templates/vmstats.html, error at line *162*
Invalid block tag: '><li><span'152 var iopsChart = 
document.getElementById('iops').getContext('2d'); 153 new 
Chart(iopsChart).Line(iopsData,{ 154 bezierCurve: false, 155 datasetFill : 
false, 156 }); 157 158 var cpuChart = 
document.getElementById('cpu').getContext('2d'); 159 new 
Chart(cpuChart).Line(cpuData,{ 160 bezierCurve: false, 161 datasetFill : 
false, 162 legendTemplate : "<ul 
class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; 
i<datasets.length; i++){%><li><span 
style=\"background-color:<%=datasets[i].lineColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>"
 
163 164 }); 165 }

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/74a6c57b-a810-4ea4-b5fb-c2961f097fbf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to