from django.shortcuts import render from rest_framework import viewsets, permissions from apps.indicatortype.models import IndicatorType from apps.indicatortype.serializers import IndicatorTypeSerializer class IndicatorTypeViewSet(viewsets.ReadOnlyModelViewSet): queryset = IndicatorType.objects.all() serializer_class = IndicatorTypeSerializer permission_classes = [ permissions.IsAuthenticatedOrReadOnly # Or anon users can't register ]