permission_classes 这个一旦设置 默认的权限管理 就失效了,需要添加验证的 都要加入permissions.IsAuthenticated
默认
REST_FRAMEWORK = {
# Use Django's standard `django.contrib.auth` permissions,
# or allow read-only access for unauthenticated users.
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.IsAuthenticated'
]
}
class AutoCallView(APIView):
"