Can we change CSRF token per-form request or even per-request instead of same token for one active session?
And if you want to use it in a middleware:
from django.middleware.csrf import rotate_token class CSRFRefresh(object): def process_response(self, request, response): rotate_token(request) return response