title: How to externalize JSON
body: <p>I have the following <code>JSON</code> in my view (simplified for this example):</p>
  
  <pre><code>video = 
       {
       'label': 'hd',
       'url': 'google',
       'format': 'mp4',
       'video_codec': 'h264',
       'audio_codec': 'aac',
       'size': '1080x720',
       }
  </code></pre>
  
  <p>And I can call a function like so: do_something(video)</p>
  
  <p>However, when I try and extract this <code>JSON</code> into an external file, as follows --</p>
  
  <pre><code>file=open('data.json')
  video=file.read()
  </code></pre>
  
  <p>I get an error, which appears to be related to having newlines and excessive spaces in the file. How would I 1) format the above json document to put it into an external file; and 2) how would I import it so I can use it with a function? Thank you.</p>