django-rest-auth icon indicating copy to clipboard operation
django-rest-auth copied to clipboard

'BasePermissionMetaclass' object is not iterable

Open BFMarks opened this issue 6 years ago • 2 comments

Keep getting this error when trying to do basic logic outside of authentication or authorization. Py3.7 and Django 2.1

BFMarks avatar Dec 11 '18 05:12 BFMarks

add this to the settings.py file

REST_FRAMEWORK = { ... 'DEFAULT_PERMISSION_CLASSES': ( 'rest_framework.permissions.IsAdminUser', ), ... }

write " permission_classes " in a pair square bracket [ ] not in () permission_classes = [permissions.IsAuthenticatedOrReadOnly]

SubhamSubhasisPatra avatar Jun 11 '20 11:06 SubhamSubhasisPatra

Even i was getting this issue and observed that i missed to add comma in last, since i am using tuple (). To fix this issue either we can user like this permission_classes = [permissions.IsAuthenticatedOrReadOnly] or permission_classes = (permissions.IsAuthenticatedOrReadOnly,)

akumarseth avatar Aug 02 '20 02:08 akumarseth