This commit is contained in:
Trey t
2023-06-15 23:44:47 -05:00
parent f0a4b2f717
commit d21a547e4b
10 changed files with 82 additions and 9 deletions

View File

@@ -1,3 +1,21 @@
from django.shortcuts import render
from .models import *
from .serializers import *
from django.shortcuts import render
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework import status
from django.contrib.auth.models import User
from django.contrib.auth import authenticate
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework.decorators import authentication_classes
from rest_framework.decorators import permission_classes
# Create your views here.
@api_view(['GET'])
def all_muscles(request):
users = Muscle.objects.all()
serializer = MuscleSerializer(users, many=True)
return Response(data=serializer.data, status=status.HTTP_200_OK)