Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to send csrf middleware token in django ajax

{% csrf_token %}
<script>
const csrftoken = document.querySelector('[name=csrfmiddlewaretoken]').value;
</script>
Source by docs.djangoproject.com #
 
PREVIOUS NEXT
Tagged: #send #csrf #middleware #token #django #ajax
ADD COMMENT
Topic
Name
4+7 =