Another way to use CSRF protection in Jinja2 Templates
Django’s Jinja2
template backend adds {{ csrf_input }}
to the context of all templates which acts same as {% csrf_token %}
in the Django template language. For example:
HTML
< form method = "post" >{{ csrf_input }} |
CSRF token in Django
Django provides a feature known as a CSRF token to get away from CSRF attacks that can be very dangerous. when the session of the user starts on a website, a token is generated which is then cross-verified with the token present with the request whenever a request is being processed.