Django's {{ csrf_token }} is outputting the token value only, without the hidden input markup Django's {{ csrf_token }} is outputting the token value only, without the hidden input markup django django

Django's {{ csrf_token }} is outputting the token value only, without the hidden input markup


You have to use it as tag {% csrf_token %} not as a variable passed by your view {{csrf_token}}


I use the next in my templates to solve your problem:

<input type='hidden' name='csrfmiddlewaretoken' value='{{ csrf_token }}' />