Django backend for WorkX project
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
このリポジトリはアーカイブされています。 ファイルの閲覧とクローンは可能ですが、プッシュや、課題・プルリクエストのオープンはできません。

views.py 497 B

123456789101112
  1. from rest_framework import viewsets
  2. from rest_framework.authentication import TokenAuthentication, SessionAuthentication
  3. from rest_framework.permissions import IsAuthenticated
  4. from .models import Project
  5. from .serializers import ProjectSerializer
  6. class ProjectViewSet(viewsets.ReadOnlyModelViewSet):
  7. queryset = Project.objects.all()
  8. serializer_class = ProjectSerializer
  9. authentication_classes = [TokenAuthentication, SessionAuthentication]
  10. permission_classes = [IsAuthenticated]