I\'d like to use a variable as an key in a dictionary in a Django template. I can\'t for the life of me figure out how to do it. If I have a product with a name or ID field,
There is a very dirty solution:
We need d[{{ k }}] So here it is: {% for key, value in d.items %} {% if k == key %} {{ value }} {% endif %} {% endfor %}