django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'corsheaders',...' # 提交表单时的认证器
],
# 2.权限配置(全局): 顺序靠上的严格
'DEFAULT_PERMISSION_CLASSES': [
# 'rest_framework.permissions.IsAdminUser...': {
# 'user': '100/hour', # 认证用户每小时100次
# 'anon': '300/day', # 未认证用户每天能访问3次
#...'UNAUTHENTICATED_USER': 'django.contrib.auth.models.AnonymousUser',
# 未认证用户使用的Token值
'UNAUTHENTICATED_TOKEN...user.utils import create_token
from rest_framework.permissions import IsAuthenticated,IsAdminUser,AllowAny