How can I hide the CSRF token from the get method in the Django? When we call the get method then only the parameters need to visible in the browser URL rather than the CSRF token.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With