from rest_framework.permissions import AllowAny
class UserViewSet(viewsets.ModelViewSet): permission_classes = [AllowAny,]
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-fram...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-rest-framework/f9f13934-f4b1-4bf7-a675-fc606cf21908%40googlegroups.com.
--
To view this discussion on the web visit https://groups.google.com/d/msgid/django-rest-framework/CAA9F9ijJTZgogDyg3ufKw%2Bm5sXuHpRFREfrdYyNKHmk%3D%3DnC_hg%40mail.gmail.com.
DjangoModelPermissions
and set the .perms_map
property. Refer to the source code for details."(!)from rest_framework.permissions import DjangoModelPermissions, IsAuthenticated
class MyDjangoModelPermissions(DjangoModelPermissions):
"""
Override `DjangoModelPermissions <https://docs.djangoproject.com/en/dev/topics/auth/#permissions>`_
to allow POST permission.
"""
perms_map = {
'GET': [],class MyViewSet(ModelViewSet):
permission_classes = MyDjangoModelPermissions
To view this discussion on the web visit https://groups.google.com/d/msgid/django-rest-framework/CAMmJSsHtbaiwAprJvD%2BOmNykXo6cE5o1%3DjCbx2Q1CRYF-0DKSA%40mail.gmail.com.