Я работаю над django 2.09 и не могу отобразить свой список в шаблоне. Вот мой код
Сервер Linux, python 3.6
view.py--------------------
.......
friends_counter = {}
index = 0
for a_campaign in campaigns:
cnt = 0
friends_counter[str(index)] = str(cnt)
for a_friend in friends:
for a_friend_campaign in a_friend.get_newsfeed_campaigns():
if(a_friend_campaign == a_campaign):
cnt+=1
break
friends_counter[str(index)] = str(cnt)
index+=1
print(friends_counter)
context['campaigns'] = campaigns
context['friends_counter'] =friends_counter
return context
template.html----------------
{% for campaign in campaigns %}
{{ campaign.name | truncatechars:20 }}
<div class="font-weight-bold mb-2">
{% with forloop.counter0 as cnt %}
{{ friends_counter.cnt }}
</div>{% endwith %}
{% endfor %}
Пожалуйста, помогите мне, спасибо!