基于mixins视图类 from rest_framework import mixins # 创建视图 class CreateModelMixin(object) def create(self, request, *args, **kwargs): # 查看所有视图 class ListModelMixin(object) def list(self, request, *args, **kwargs): # 查看单个视图 class RetrieveModelMixin(object)…