Django viewset has not attribute 'get_extra_actions'

前端 未结 6 1004
盖世英雄少女心
盖世英雄少女心 2020-12-03 02:40

I am working with Django for a first time and I\'m trying to build an API and I am following some tutorials and examples and it works right, but I am running the project now

6条回答
  •  悲&欢浪女
    2020-12-03 03:21

    You've called it a viewset, but that doesn't make it one; you inherit from APIView which is a standalone generic view, not a viewset.

    A viewset needs to inherit from viewsets.ViewSet.

提交回复
热议问题