I am using the django template system and I am having the following problem:
I pass the dictionary object, example_dictionary, to the template:
example_dictionary = {key1 : [value11,value12]}
and I want to do the following:
{% for key in example_dictionary %} // stuff here (1) {% for value in example_dictionary.key %} // more stuff here (2) {% endfor %} {% endfor %}
However, this is not included in the second cycle of the cycle.
Indeed, if I put
{{ key }}
on (1), it shows the correct key, however
{{ example_dictionary.key }}
nothing is displayed.
In this answer , someone suggested using
{% for key, value in example_dictionary.items %}
However, this does not work in this case, because I want (1) to have information about a specific key.
How do I achieve this? Did I miss something?
source share