text: from django.shortcuts import render
  from rest_framework import generics
  from .models import Posts
  from .serializers import PostsSerializer 
  
  class PostsList(generics.ListCreateAPIView):
      queryset = Posts.objects.all()
      serializer_class = PostsSerializer
  
  class PostsDetail(generics.RetrieveUpdateDestroyAPIView):
      queryset = Posts.objects.all()
      serializer_class = PostsSerializer