title: django + angularjs resource + ajax POST = 500 (Internal Server Error)
body: <p>I can do GET requests, but when I do POST, in Chrome developer tools I see: "Failed to load resource: the server responded with a status of 500 (INTERNAL SERVER ERROR)"</p>
  
  <p>I thought the problem is in Django's csrf_token, so I found this solution:</p>
  
  <pre><code>.config(function($httpProvider){
      $httpProvider.defaults.headers.common['X-CSRFToken'] = CSRF_TOKEN;
  });
  </code></pre>
  
  <p>In my <code>index.html</code>, in <code>&lt;head&gt;</code> I have:</p>
  
  <pre><code>&lt;script&gt;
      CSRF_TOKEN = '{{ csrf_token }}';
  &lt;/script&gt;
  </code></pre>
  
  <p>But it still raises 500 error. Am I doing something wrong or the problem is not in csrf?</p>
  
  <p>P.S. <code>CSRF_TOKEN</code> is declared before </p>
  
  <pre><code>&lt;script src="{{ STATIC_URL }}lib/angular/angular.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>and other scripts.</p>