From 3e6690c7ff810f4824d1c696ec6625855d12aebb Mon Sep 17 00:00:00 2001 From: nick2wang Date: Sun, 24 Apr 2022 11:42:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0session=E9=89=B4=E6=9D=83?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archery/settings.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/archery/settings.py b/archery/settings.py index 053453f1af..c01e6bb1b6 100644 --- a/archery/settings.py +++ b/archery/settings.py @@ -180,8 +180,11 @@ REST_FRAMEWORK = { 'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema', 'DEFAULT_RENDERER_CLASSES': ('rest_framework.renderers.JSONRenderer',), - # 授权 - 'DEFAULT_AUTHENTICATION_CLASSES': ('rest_framework_simplejwt.authentication.JWTAuthentication',), + # 鉴权 + 'DEFAULT_AUTHENTICATION_CLASSES': ( + 'rest_framework_simplejwt.authentication.JWTAuthentication', + 'rest_framework.authentication.SessionAuthentication', + ), # 权限 'DEFAULT_PERMISSION_CLASSES': ('sql_api.permissions.IsInUserWhitelist',), # 限速(anon:未认证用户 user:认证用户)