Last active
August 29, 2015 14:25
-
-
Save acatejr/034de17fa56023c16a9e to your computer and use it in GitHub Desktop.
Angular Brackets and CSRF Tokens for Django
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Change the Angular brackets to [[ and ]] | |
$interpolateProvider.startSymbol('[[').endSymbol(']]'); | |
// Tells the app to use csrf token in views | |
$httpProvider.defaults.xsrfCookieName = 'csrftoken'; | |
$httpProvider.defaults.xsrfHeaderName = ' X-CSRFToken'; | |
// Stop Angular strip trailing slashes. Angular loves to strip trailing slashes. | |
// Newer in Angular 3 | |
$resourceProvider.defaults.stripTrailingSlashes = false; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment