我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用rest_framework.authentication.SessionAuthentication()。
def get_settings(): """Due to app loading issues during startup provide a function to return settings only when needed.""" # Import late because apps may not be loaded yet from rest_framework.authentication import SessionAuthentication, BasicAuthentication return getattr(settings, "REST_FRAMEWORK_EXTRAS", { "blacklist": { "sessions-session": {}, "admin-logentry": {}, }, "authentication-classes": (SessionAuthentication, BasicAuthentication), "permission-classes": (DjangoModelPermissions,) })