52👍
✅
You have to use it as tag {% csrf_token %}
not as a variable passed by your view {{csrf_token}}
11👍
I use the next in my templates to solve your problem:
<input type='hidden' name='csrfmiddlewaretoken' value='{{ csrf_token }}' />
Source:stackexchange.com