Django, send dictionary to template
<p>Is it possible to send a dictionary to a template. And use the django/python magic to work on it client side?</p>

<p>The view function</p>

<pre><code>def index(request):

    context = {
               'users' : users,
               'investments' : { 'one' : 1, 'two' : 2 },
    }
    return render(request, 'index.html', context)
</code></pre>

<p>And the html</p>

<pre><code>{% if investments %}
    &lt;h1&gt;{{ investments['one'] }}&lt;/h1&gt; #&lt;---- something like that.
{% endif %}
</code></pre>

<p>The code below works in Flask-Jinja, and I believe should work in Django:</p>

<pre><code>{% if investments %}
    &lt;h1&gt;{{ investments.one }}&lt;/h1&gt;
{% endif %}
</code></pre>

python django