Tivix / django-rest-auth

This app makes it extremely easy to build Django powered SPA's (Single Page App) or Mobile apps exposing all registration and authentication related functionality as CBV's (Class Base View) and REST (JSON)
www.tivix.com
MIT License
2.41k stars 660 forks source link

'BasePermissionMetaclass' object is not iterable #491

Open BFMarks opened 5 years ago

BFMarks commented 5 years ago

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

SubhamSubhasisPatra commented 4 years ago

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]

akumarseth commented 4 years ago

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,)