def before_auth_request(): if 'application/json' not in request.accept_mimetypes: return errors.not_acceptable()