How to use django template dot notation inside a for loop
问题 I am trying to retrieve the value of a dictionary key and display that on the page in a Django template: {% for dictkey in keys %} <p> {{ mydict.dictkey }} </p> {% endfor %} (let's say 'keys' and 'mydict' have been passed into the template in the Context) Django renders the page but without the dictionary contents ("Invalid template variable") I assume the problem is that it is trying to do mydict['dictkey'] instead of mydict[ actual key IN the variable dictkey ]? How does one "escape" this