Skip to content

Instantly share code, notes, and snippets.

@krescruz
Created December 20, 2017 18:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save krescruz/b431744b6b0e3eb6ce3892d61e837d28 to your computer and use it in GitHub Desktop.
Save krescruz/b431744b6b0e3eb6ce3892d61e837d28 to your computer and use it in GitHub Desktop.
Config Cross Site Request Forgery Protection CSRF in axios for django
import axios from 'axios'
/**
* Config global for axios/django
*/
axios.defaults.xsrfHeaderName = "X-CSRFToken"
axios.defaults.xsrfCookieName = 'csrftoken'
export default axios
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment