TypeError while using django rest framework tutorial

前端 未结 5 862
无人共我
无人共我 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:18

    Just to let others know, I kept getting this same error and found that I forgot to include a comma in my REST_FRAMEWORK. I had this:

    'DEFAULT_PERMISSION_CLASSES': (
        'rest_framework.permissions.IsAuthenticated'
    ),
    

    instead of this:

    'DEFAULT_PERMISSION_CLASSES': (
        'rest_framework.permissions.IsAuthenticated',
    ),
    

    The comma defines this as a one-element tuple

提交回复
热议问题