TypeError while using django rest framework tutorial

前端 未结 5 858
无人共我
无人共我 2020-12-30 22:19

I am new to using Django Rest framework, i am following this tutorial Django-Rest-Framework

Instead of snippets my model consists of a userprofile as given belo

5条回答
  •  [愿得一人]
    2020-12-30 23:10

    I had the same error when I used custom permissions, because of a 'typo'

    I had:

    @permission_classes(EventByFacilityPermissions)
    class EventByFacilityViewSet(viewsets.ModelViewSet):
    

    instead of:

    @permission_classes((EventByFacilityPermissions,))
    class EventByFacilityViewSet(viewsets.ModelViewSet):
    

提交回复
热议问题