def rotate_token(request):
    request.META.update({
        "CSRF_COOKIE_USED": True,
        "CSRF_COOKIE": _get_new_csrf_key(),
    })
Changes the CSRF token in use for a request - should be done on login
dataset/ETHPy150Open django/django/django/middleware/csrf.py/rotate_token