|
- from rest_framework import viewsets
- from rest_framework.authentication import TokenAuthentication, SessionAuthentication
- from rest_framework.permissions import IsAuthenticated
- from .models import Project
- from .serializers import ProjectSerializer
-
-
- class ProjectViewSet(viewsets.ReadOnlyModelViewSet):
- queryset = Project.objects.all()
- serializer_class = ProjectSerializer
- authentication_classes = [TokenAuthentication, SessionAuthentication]
- permission_classes = [IsAuthenticated]
|