@contextlib.contextmanager
def skip_cross_domain_referer_check(request):
 is_secure_default = request.is_secure
 request.is_secure = (lambda : False)
 try:
  (yield)
 finally:
  request.is_secure = is_secure_default

@ contextlib . contextmanager def skip_cross_domain_referer_check ( request ) : is_secure_default = request . is_secure request . is_secure = ( lambda : False ) try : ( yield ) finally : request . is_secure = is_secure_default
skip the cross-domain csrf referer check .