hi I have a python dictionary. How do I output the list of keys in django?
If I do something like
{% for key in dict.keys() %}
<tr> <td> key </td> </tr>{% endfor %}
I get
TemplateSyntaxError: Could not parse the remainder: ‘()’ from
‘dict.keys()’
Thanks!
You have to use {{ key }} inside the loop for this to work. Also:
{% for key in dict.keys %}