Is there any way to get csrftoken in View straightly?
I want to get the current csrftoken in view but will change sometimes so get it from Cookies is not a good idea.
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?