Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Yogendra0Sharma/42870b90e3b7c446b4c04083b1c2960a to your computer and use it in GitHub Desktop.
Save Yogendra0Sharma/42870b90e3b7c446b4c04083b1c2960a to your computer and use it in GitHub Desktop.
ANGULARJS - Django CSRF Token header setup
var myApp = angular.module('myApp').config(function($httpProvider) {
$httpProvider.defaults.headers.post['X-CSRFToken'] = $('input[name=csrfmiddlewaretoken]').val();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment