I having a dictionary
a = {'name': u'45445454',
'tracks': [{'A_TITLE': u'abb',
'IS': u'144',
'PN': u'3',
'T_TITLE': u'123'},
{'A_TITLE': u'abb',
'IS': u'45454454',
'PN': u'3',
'T_TITLE': u'225'},
{'A_TITLE': u'ggg',
'IS': u'232',
'PN': u'000',
'T_TITLE': u'555'}]}
I want to redner this dict to my html page.
my html code is not working.
<table>
<tr>
{% for e in tracks %}
<td> e['IS']</td>
<td> e['PN']</td>
....
.,..
{% endfor %}
<tr>
</table>
The above code throws an error.
I have changed this to
<table>
{% for e in tracks %}
<tr> <td> Title </td> <td> {{ e.A_TITLE }} - PN {{ e.PN }}</td>
<tr> <td> tc </td><td> {{e.T_TITLE }} - ISRC {{e.IS }} </td></tr>
{% endfor %}
</table>
Now it is working good , And you see the dict the A_Title and PN key are dependent.
I want this to be render in html page like.
<tr> <td> abb - 3 </td>
<td> 123 - 144</td>
<td> 225 - 45454454</td>
</tr>
<tr> <td> ggg - 000</td>
<td> 555 - 232</td>
</tr>
or else in this format
<tr> <td> abb - 3 </td></tr>
<tr> <td> 123 - 144</td>
<td> 225 - 45454454</td>
</tr>
<tr> <td> ggg - 000</td></tr>
<tr> <td> 555 - 232</td>
</tr>
{{ e.IS }}insteade['IS']<tr>tags inside loop, Btw, your closing<tr>tag is incorrect