title: Django- adding to server header (CORS)
body: <p>I am getting a CORS error as my browser doesn't like localhost domains for Ajax. </p>
  
  <p><em>I believe</em> I need to add these to the server header so I can test locally.</p>
  
  <pre><code>'Access-Control-Allow-Origin' : '*',
  'Access-Control-Allow-Methods' : 'POST, GET, OPTIONS, PUT',
  'Content-Type': 'application/json',
  </code></pre>
  
  <p>How to I write this in Django and what file does it belong in- middleware.py?</p>