title: Converting dict object to string in Django/Jinja2 template
body: <p>If you use Django or Jinja2, you've probably ran into this problem before.
  I have a JSON string that looks like this:</p>
  
  <pre><code>{
    "data":{
      "name":"parent",
      "children":[
        {
          "name":"child_a",
          "fav_colors":[
            "blue",
            "red"
          ]
        },
        {
          "name":"child_b",
          "fav_colors":[
            "yellow",
            "pink"
          ]
        }
      ]
    }
  }
  </code></pre>
  
  <p>Now I want to pass this to my Jinja2 template:</p>
  
  <pre><code>j = json.loads('&lt;the above json here&gt;')
  self.render_response('my_template.html', j)
  </code></pre>
  
  <p>...and iterate it like this:</p>
  
  <pre><code>&lt;select&gt;
  {% for p in data recursive %}
          &lt;option disabled&gt;{{ p.name }}&lt;/option&gt;
          {% for c in p.children %}
              &lt;option value="{{ c.fav_colors|safe }}"&gt;{{ c.name }}&lt;/option&gt;
          {% endfor %}
  {% endfor %}
  &lt;/select&gt;
  </code></pre>
  
  <p>This is where I'm having the problem: everything works except Jinja2 outputs unicode encoded values for c.fav_colors. I need c.fav_colors as a valid javascript array so that I can access it from javascript. How can I get Jinja to print that value as ascii text like: <code>['blue','red']</code> instead of <code>[u'blue', u'red']</code> ?</p>