Answer the question
In order to leave comments, you need to log in
How can I loop through the keys of a dictionary in a Django template where the value is a list?
Good afternoon! Through views I pass the dictionary to the template:
data = {'queryString': [], 'date': []}
In the template, you need to insert data from the dictionary into the links, this way did not work:
{% for date, queryString in data %}
<a href="logs/{{ queryString }}">{{ date }}</a><br />
{% endfor %}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question