from rest_framework import viewsets, permissions

from .models import Farmer
from .serializers import FarmerSerializer


class FarmerViewSet(viewsets.ModelViewSet):
    queryset = Farmer.objects.all()
    serializer_class = FarmerSerializer
    filter_fields = ('town',)
    permissions = permissions.DjangoModelPermissionsOrAnonReadOnly

from rest_framework import viewsets

from .models import Farmer
from .serializers import FarmerSerializer


class FarmerViewSet(viewsets.ReadOnlyModelViewSet):
    queryset = Farmer.objects.all()
    serializer_class = FarmerSerializer
    filter_fields = ('town',)

--- 
+++ 
@@ -1,10 +1,11 @@
-from rest_framework import viewsets
+from rest_framework import viewsets, permissions
 
 from .models import Farmer
 from .serializers import FarmerSerializer
 
 
-class FarmerViewSet(viewsets.ReadOnlyModelViewSet):
+class FarmerViewSet(viewsets.ModelViewSet):
     queryset = Farmer.objects.all()
     serializer_class = FarmerSerializer
     filter_fields = ('town',)
+    permissions = permissions.DjangoModelPermissionsOrAnonReadOnly
Add permission settings on FarmerViewSet
