4๐
โ
Please put {% csrf_token %}
inside <form>
tag. This will solve the issue.
๐คShamir Imtiaz
2๐
{% csrf_token %}
should be inside the form tag.
like this
<form action="." method="POST">
{% csrf_token %}
<input type="text" name="eur" placeholder="EUR">
<input type="submit">
</form>
The reason behind that is because {% csrf_token %}
is rendered like this, and inorder input to be submitted along with form it needs to be inside form element.
<input type="hidden" name="csrfmiddlewaretoken" value="0gdrskkUXOTenFZOWxhzQPZWavohLKrEaOm0aKj8KzOfeLFah9PihEdYG24Fl4F7">```
๐คRahul Palve
1๐
You need to put {% csrf_token %}
inside the <form>
tag like this:
<form action="." method="POST">
{% csrf_token %}
<input type="text" name="eur" placeholder="EUR">
<input type="submit">
</form>
๐คuser15256253
- [Django]-Factory boy error : ValueError: save() prohibited to prevent data loss due to unsaved related object
- [Django]-Google Analytics reports API โ Insufficient Permission 403
- [Django]-Composite primary key, Google app engine (django)
1๐
There is error in your form file, your csrf_token is expected to be inside your tag because django is expecting it with the form data as to certify that what you are sending is safe. Try this
<form action="." method="POST">
{% csrf_token %}
<input type="text" name="eur" placeholder="EUR">
<input type="submit">
</form>
It will work that way.
๐คsamkayz
- [Django]-Searching for a project skeleton for Chef + Django on Linux
- [Django]-Redirect realtime common line output to Django HttpResponse
Source:stackexchange.com