[Answered ]-Why is this django template not working?

2👍

In your data:

{'PAP': 10, 'btw': 10, 'via': 20, 'crowd': 10, 'is': 10, 'half': 10, 'anyway': 10, "#fb'": 10, 'items': 10, '[@leynaaaa': 10, 'are': 10}

There’s a key called items. Can you pass in a test dictionary without the items key to the template to see if it works?

Workaround:

Assuming you can’t rename the items key, you can pass in {'latest_status': tags.items()} from your view. In the template, do a for loop on {% for k, v in latest_status %}.

0👍

latest_status.items is returning a single integer, not an interable data-structure.

Log the value of latest_status.items and tell me what you get.

👤bdd

Leave a comment