from rest_framework import viewsets from .serializers import UserSerializer from django.contrib.auth.models import User from rest_framework.permissions import IsAuthenticated # Create your views here. class UserListViewSet(viewsets.ModelViewSet): permission_classes = [IsAuthenticated] http_method_names = ['get'] serializer_class = UserSerializer queryset = User.objects.all()