from rest_framework import viewsets from rest_framework.permissions import DjangoModelPermissionsOrAnonReadOnly from .models import Agent from .serializers import AgentSerializer class AgentViewSet(viewsets.ModelViewSet): queryset = Agent.objects.all() serializer_class = AgentSerializer permission_class = [DjangoModelPermissionsOrAnonReadOnly]