def _turn_off_csrf(request):
 csrf_token = csrf._get_new_token()
 request.headers.cookie['csrf_token'] = csrf_token
 request.headers['X-CSRF-TOKEN'] = csrf_token

def _turn_off_csrf ( request ) : csrf_token = csrf . _get_new_token ( ) request . headers . cookie [ 'csrf_token' ] = csrf_token request . headers [ 'X-CSRF-TOKEN' ] = csrf_token
given a request .