Answers for "dango rest framework"

12

install django rest framework

pip install djangorestframework
Posted by: Guest on September-10-2020
0

drf

def get_permissions(self):
    """
    Instantiates and returns the list of permissions that this view requires.
    """
    if self.action == 'list':
        permission_classes = [IsAuthenticated]
    else:
        permission_classes = [IsAdmin]
    return [permission() for permission in permission_classes]
Posted by: Guest on October-08-2020

Browse Popular Code Answers by Language