title: Passing a Dictionary from Django view to a Django template
body: <p>I am trying to pass the following context from views.py to a Django Template:</p>
  <p>views.py:</p>
  <pre><code>def home(request):
       context = {
             'dict_1': {'key_1': ['val_11', 'val_12'], 'key_2': ['val_21', 'val_22']} 
            }
  return render(request, 'app/home.html', context)
  </code></pre>
  <p>home.html:</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot;&gt;
      var java_dict = {{ dict_1 }};
      console.log(java_dict);
  &lt;/script&gt;
  </code></pre>
  <p>This throws an error: <em>Uncaught SyntaxError: Unexpected token '&amp;'</em></p>
  <p>Upon investigating, I see that the dictionary in javascript is read as follows:</p>
  <pre><code>{&amp;#39;key_1&amp;#39;: [&amp;#39;val_11&amp;#39;, &amp;#39;val_12&amp;#39;], &amp;#39;key_2&amp;#39;: [&amp;#39;val_21&amp;#39;, &amp;#39;val_22&amp;#39;]}
  </code></pre>
  <p>which probably means that the quotes-character (') is read incorrectly. How do I fix this issue?</p>