old_contents: from django.shortcuts import render
  from .models import Resource
  from .serializers import ResourceSerializer
  from rest_framework import generics
  
  
  class ResourceList(generics.ListCreateAPIView):
      queryset = Resource.objects.all()
      serializer_class = ResourceSerializer
  
  
  class ResourceDetail(generics.RetrieveUpdateDestroyAPIView):
      queryset = Resource.objects.all()
      serializer_class = ResourceSerializer
  
new_contents: from django.shortcuts import render
  from .models import Resource
  from .serializers import ResourceSerializer
  from rest_framework import generics, permissions
  
  
  class ResourceList(generics.ListCreateAPIView):
      queryset = Resource.objects.all()
      serializer_class = ResourceSerializer
      permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
  
  
  class ResourceDetail(generics.RetrieveUpdateDestroyAPIView):
      queryset = Resource.objects.all()
      serializer_class = ResourceSerializer
      permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
  
subject: Make the API read only unless authenticated.