1👍
✅
You can use dict.items
method. In python 2.x better use dict.iteritems
instead.
{% for y_key, yr in archives.items %}
<li>{{ yr.year }} ({{ yr.count }})</li>
{% for m_key, mth in yr.months.items %}
<li> - {{ mth.month_name }} ({{ mth.count }})</li>
{% endfor %}
{% endfor %}
Source:stackexchange.com