[Django]-Hide csrf token in get method in the django

7👍

The CSRF protection ignores GET requests (see how it works). Therefore you can simply remove {% csrf_token%} from the form in your template.

<form method="get" action=".">
  {% csrf_token %}<!-- remove this line -->
  {{ form }}
</form>

4👍

Remove {% csrf_token %} from your form in the template, you don’t need it since you’re making a GET request.

Leave a comment