Skip to content

Commit

Permalink
增加session鉴权方式
Browse files Browse the repository at this point in the history
  • Loading branch information
nick2wang committed Apr 24, 2022
1 parent c7214af commit 3e6690c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions archery/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:认证用户)
Expand Down

0 comments on commit 3e6690c

Please # to comment.