Django backend for WorkX project
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Deze repo is gearchiveerd. U kunt bestanden bekijken en het klonen, maar niet pushen of problemen/pull-requests openen.
|
- from rest_framework.response import Response
- from rest_framework.views import APIView
- from rest_framework.authentication import TokenAuthentication, SessionAuthentication
- from rest_framework.permissions import IsAuthenticated
- from .models import Project
- from .serializers import ProjectSerializer
-
-
- class ProjectList(APIView):
- authentication_classes = [TokenAuthentication, SessionAuthentication]
- permission_classes = [IsAuthenticated]
-
- def get(self, request):
- projects = Project.objects.all()
- serializer = ProjectSerializer(projects, many=True)
- return Response(serializer.data)
|