title: Use variable as dictionary key in Django template
body: <p>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, and ratings dictionary with indices of the product IDs, I'd like to be able to say:</p>
  
  <pre><code>{% for product in product_list %}
       &lt;h1&gt;{{ ratings.product.id }}&lt;/h1&gt;
  {% endfor %}
  </code></pre>
  
  <p>In python this would be accomplished with a simple</p>
  
  <pre><code>ratings[product.id]
  </code></pre>
  
  <p>But I can't make it work in the templates. I've tried using with... no dice. Ideas?</p>