title: Python/Django json.loads() error when loading JSON File
body: <p>In my Django project I have the following directory structure:</p>
  <pre><code>project/build/contracts/MyFile.json
  </code></pre>
  <p>And I am writing code in the following directory</p>
  <pre><code>project/homeapp/views.py
  </code></pre>
  <p>In my <code>views.py</code> I have the following code:</p>
  <pre><code>with open(&quot;../build/contracts/MyFile.json&quot;, &quot;r&quot;) as f:
      data = json.loads(f.read())
      abi = data[&quot;abi&quot;]
  </code></pre>
  <p>When I try to <code>python manage.py runserver</code> I get the following error:
  <a href="https://i.stack.imgur.com/SDeBI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SDeBI.png" alt="enter image description here" /></a></p>
  <p>The strange part is that I couldn't figure out what was wrong so I made a <code>viewstest.py</code> and placed the exact same code in it. When I run it with <code>python .\viewstest.py</code> and print the JSON to console, it works perfectly fine.</p>
  <p>I even tried importing the <code>abi</code> variable from <code>viewstest.py</code> to <code>views.py</code> but got the same error. So I assume that it is an error relating to Django, but I can't seem to figure it out.</p>
  <p>Thanks!</p>