Reputation: 1
I'm using django and a static html file.
i add {% csrf_token %}
tag in my html.
<form data-toggle="validator" role="form" action="/form/" method="post">
{% csrf_token %}
<!some inputs>
</form>
But when i refresh the page there is a text above my form {% csrf_token %}
Why html tag is not working?
Upvotes: 0
Views: 1018
Reputation: 5607
Another option is to use JavaScript to get csrf token:
https://docs.djangoproject.com/en/dev/ref/csrf/#ajax
Upvotes: 1