'Skip the referer check if the cross-domain request is allowed.'

def enforce_csrf(self, request):

    if is_cross_domain_request_allowed(request):
        with skip_cross_domain_referer_check(request):
            return super(SessionAuthenticationCrossDomainCsrf, self).enforce_csrf(request)
    else:
        return super(SessionAuthenticationCrossDomainCsrf, self).enforce_csrf(request)
