text: #from django.shortcuts import render
  
  from rest_framework import viewsets
  from .serializers import PlayerSerializer, TeamSerializer
  from .models import Player, Team
  
  
  class PlayerViewSet(viewsets.ModelViewSet):
      """
      API endpoint that allows players to be viewed or edited.
      """
      queryset = Player.objects.all()
      serializer_class = PlayerSerializer
  
  
  class TeamViewSet(viewsets.ModelViewSet):
      """
      API endpoint that allows teams to be viewed or edited.
      """
      queryset = Team.objects.all()
      serializer_class = TeamSerializer
  
  