def rotate_token(request):
 request.META.update({'CSRF_COOKIE_USED': True, 'CSRF_COOKIE': _get_new_csrf_token()})
 request.csrf_cookie_needs_reset = True

def rotate_token ( request ) : request . META . update ( { 'CSRF_COOKIE_USED' : True , 'CSRF_COOKIE' : _get_new_csrf_token ( ) } ) request . csrf_cookie_needs_reset = True
changes the csrf token in use for a request - should be done on login for security purposes .