渲染器: from rest_framework.renderers import BrowsableAPIRenderer,AdminRenderer,HTMLFormRenderer,JSONRenderer class TestView(APIView): renderer_classes = [JSONRenderer,BrowsableAPIRenderer, ] #建议只加这两个 get(self,reuqest,*args,**kwargs): #获取数据 models.Role.…