jorgebastida / django-dajax

Easy to use library to create asynchronous presentation logic with django and dajaxice
http://dajaxproject.com/
BSD 3-Clause "New" or "Revised" License
346 stars 99 forks source link

Does django-ajax automate CSRF tokens? #80

Open gummz opened 10 years ago

gummz commented 10 years ago

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.

Hiieu commented 9 years ago

in your html

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

In your js code just use CSRF_TOKEN