全局验证
REST_FRAMEWORK={'DEFAULT_AUTHENTICATION_CLASSES':('rest_framework.authentication.BasicAuthentication','rest_framework.authentication.SessionAuthentication','rest_framework.authentication.TokenAuthentication',),}
局部验证
authentication_classes=[MyAuthentication]
自定义验证
新建一个 Authentication文件
创建一个类继承 BaseAuthentication