Skip to content

redapesolutions/angular-django-csrf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

angular-django-csrf

creates an AngularJS $http interceptor which adds the CSRF token for Django use

Install

$ bower install angular-django-csrf

Usage

  • Make sure the angular-django-csrf.js file is added to your index.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']);

Dependencies

ngCookies is a required dependency of this module.

About

Angular $http interceptor that adds CSRF token for Django

Resources

Stars

Watchers

Forks

Packages

No packages published