How can i get csrftoken in view? How can i get csrftoken in view? python python

How can i get csrftoken in view?


I believe you're looking for this:

django.middleware.csrf.get_token(request)

or

{% csrf_token %}

Reference: How can I embed django csrf token straight into HTML?