creates an AngularJS $http interceptor which adds the CSRF token for Django use
$ bower install angular-django-csrf
- Make sure the
angular-django-csrf.js
file is added to yourindex.html
- Add the
angularDjangoCsrf
module to the list of your app dependencies - Ensure that you have
ngCookies
loaded in your app as well
Add a <script>
to your index.html
:
<script src="/bower_components/angular-cookies/angular-cookies.js"></script>
<script src="/bower_components/angular-django-csrf/angular-django-csrf.js"></script>
And add angularDjangoCsrf
as a dependency for your app:
angular.module('myApp', ['ngCookies', 'angularDjangoCsrf']);
ngCookies
is a required dependency of this module.