django-dajax icon indicating copy to clipboard operation
django-dajax copied to clipboard

Does django-ajax automate CSRF tokens?

Open gummz opened this issue 11 years ago • 1 comments

I can't for the life of me figure out how to include ajax CSRF tokens myself, so I'm looking for someone more clever than I am to have done it before me.

gummz avatar Aug 15 '14 20:08 gummz

in your html

<script> window.CSRF_TOKEN = "{{ csrf_token }}";</script>

In your js code just use CSRF_TOKEN

Hiieu avatar Aug 11 '15 12:08 Hiieu