Django Rest Framework: 'function' object has no attribute 'as_view'

后端 未结 5 1090
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-30 01:34

I\'ve been trying for a while to get a ModelResource or a View working using the Django Rest Framework. I\'m following the examples but the code in the examples is not worki

5条回答
  •  情书的邮戳
    2020-12-30 01:50

    def TestView(View): should be class TestView(View):. As it stands, you define a function called TestView which takes an argument called View -- its body defines an inner function, then returns None.

提交回复
热议问题