title: angular, django and csrf
body: <p>from <a href="http://docs.angularjs.org/api/ng">http://docs.angularjs.org/api/ng</a>.$http , it says we should set default headers to include the token, so i am following it.</p>
  
  <p>my code goes something like this</p>
  
  <pre><code>var myapp = angular.module('myapp', ['ngCookies', 'ui.bootstrap']).
      config(['$routeProvider', function($routeProvider, $httpProvider, $cookies){
          $routeProvider.
              when('/', {
                  templateUrl: '/partials/home.html',
                  controller: HomeCtrl
              }).
              when('/game/:gameId/shortlist/create',{
                  templateUrl: '/partials/create-shortlist.html',
                  controller: CreateShortlistCtrl
              }).
              otherwise({redirectTo: '/'});
      }]);
  
  myapp.run(function($rootScope, $http, $cookies, $httpProvider){
      $http.get('/api/get-current-user').success(function(data){
          $rootScope.current_user = data;
          $rootScope.current_team = $rootScope.current_user.team;
      });
      $http.get('/api/get-current-season').success(function(data){
          $rootScope.current_season = data;
      });
      $rootScope.csrf_token = $cookies.csrftoken;
      console.log($httpProvider.defaults.headers.common);
      //$httpProvider.defaults.headers.post['X-CSRFToken'] = $cookies.csrftoken;
  });
  </code></pre>
  
  <p>as you can see, i have applied multiple approaches but am unable to set header with csrf token. the two errors i have encountered are</p>
  
  <blockquote>
    <p>Uncaught Error: Unknown provider: $httpProviderProvider &lt;-
    $httpProvider</p>
  </blockquote>
  
  <p>what am i doing wrong?</p>