JSON to JS with Django: SyntaxError: missing : after property id
<p>I'm attempting to get a JSON file into a script. I can't seem to be able to get it there by serving it from the filesystem so I made a view that returns the JSON data to the page like so:</p>

<pre><code>def graph(request, d):                  #d.data is the file in the database
    data = json.load(d.data)
    return render(request, 'temp/template.html', {'json': data})
</code></pre>

<p>In my JS:</p>

<pre><code>var j = {{ json|safe }};
</code></pre>

<p>When I look at the source for the JS it shows the data in this format:</p>

<pre><code>{u'people': [{u'name': u'steve'}, {u'name': u'dave'}]}
</code></pre>

<p>Which I read shouldn't be a problem. I don't have any variables called 'id' and yet I get the error in the title pointing to the provided line of JS.</p>

<p>Why could this be? Also how do I then use the objects from the JSON in my script?</p>