Accessing dictionaries given django template’s attributes?

So my problem is that I need to iterate over a dictionary given an attribute, which is the value of the for loop. For example, I have a dictionary called my_dictionary which is being iterated by a for loop in a django template, with an attribute called q. What I need is to access to that dictionary by using the q attribute. I tried with {{my_dictionary.q}}, {{my_dictionary.{{q}} }} but none of them did work. What can I do? I guess it should be similar as in Python my_dictionary[q]. Thank you.