视图: a. django class Test(View): ... b. rest_framework class Test(APIView): ... c. GenericAPIView 一般不用这个类来做视图 from rest_framework.generics import GenericAPIView class ViewView(GenericAPIView): queryset = models.Role.objects.all() serializer_class = Pa…