1👍
I think you should use this as :
{% for value in sites %}
<li>{{value.site}}</li>
{% endfor %}
It will now print the values in list
0👍
You can access a key in a dictionary using the dot notation:
Dictionary lookup, attribute lookup and list-index lookups are implemented with a dot notation:
{{ my_dict.key }} {{ my_object.attribute }} {{ my_list.0 }}
For your code, that would be:
{% for value in sites %}
<li>{{value.site}}</li>
{% endfor %}
👤2ps
- Django: serve static section of a web-app
- Blank=True not working on CloudinaryField()
- Django if else template tag queryset not right
- Django. Print all admin actions.
- Django 1.10 : view function() takes exactly 2 arguments (1 given)
Source:stackexchange.com