prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Pagination of the project list
  When fetching projects in the project list page, is it intentional that all projects are fetched at once even though there is pagination?
  
  Endpoint of project list fetching: `/v1/projects`
  
  When there are a lot of projects, it takes a long time to display them.
  
  Your Environment
  ---------
  doccano v1.5.5
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `backend/api/views/project.py`
  Content:
  ```
  1 from django.conf import settings
  2 from rest_framework import generics, status
  3 from rest_framework.permissions import IsAdminUser, IsAuthenticated
  4 from rest_framework.response import Response
  5 
  6 from members.permissions import IsProjectAdmin, IsProjectStaffAndReadOnly
  7 
  8 from ..models import Project
  9 from ..serializers import ProjectPolymorphicSerializer
  10 
  11 
  12 class ProjectList(generics.ListCreateAPIView):
  13     serializer_class = ProjectPolymorphicSerializer
  14     pagination_class = None
  15 
  16     def get_permissions(self):
  17         if self.request.method == 'GET':
  18             self.permission_classes = [IsAuthenticated, ]
  19         else:
  20             self.permission_classes = [IsAuthenticated & IsAdminUser]
  21         return super().get_permissions()
  22 
  23     def get_queryset(self):
  24         return Project.objects.filter(role_mappings__user=self.request.user)
  25 
  26     def perform_create(self, serializer):
  27         serializer.save(created_by=self.request.user)
  28 
  29     def delete(self, request, *args, **kwargs):
  30         delete_ids = request.data['ids']
  31         projects = Project.objects.filter(
  32             role_mappings__user=self.request.user,
  33             role_mappings__role__name=settings.ROLE_PROJECT_ADMIN,
  34             pk__in=delete_ids
  35         )
  36         # Todo: I want to use bulk delete.
  37         # But it causes the constraint error.
  38         # See https://github.com/django-polymorphic/django-polymorphic/issues/229
  39         for project in projects:
  40             project.delete()
  41         return Response(status=status.HTTP_204_NO_CONTENT)
  42 
  43 
  44 class ProjectDetail(generics.RetrieveUpdateDestroyAPIView):
  45     queryset = Project.objects.all()
  46     serializer_class = ProjectPolymorphicSerializer
  47     lookup_url_kwarg = 'project_id'
  48     permission_classes = [IsAuthenticated & (IsProjectAdmin | IsProjectStaffAndReadOnly)]
  49
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/backend/api/views/project.py b/backend/api/views/project.py
  --- a/backend/api/views/project.py
  +++ b/backend/api/views/project.py
  @@ -1,5 +1,6 @@
   from django.conf import settings
  -from rest_framework import generics, status
  +from django_filters.rest_framework import DjangoFilterBackend
  +from rest_framework import filters, generics, status
   from rest_framework.permissions import IsAdminUser, IsAuthenticated
   from rest_framework.response import Response
   
  @@ -11,7 +12,8 @@
   
   class ProjectList(generics.ListCreateAPIView):
       serializer_class = ProjectPolymorphicSerializer
  -    pagination_class = None
  +    filter_backends = (DjangoFilterBackend, filters.SearchFilter, filters.OrderingFilter)
  +    search_fields = ('name', 'description')
   
       def get_permissions(self):
           if self.request.method == 'GET':
  
verification_info: {"golden_diff": "diff --git a/backend/api/views/project.py b/backend/api/views/project.py\n--- a/backend/api/views/project.py\n+++ b/backend/api/views/project.py\n@@ -1,5 +1,6 @@\n from django.conf import settings\n-from rest_framework import generics, status\n+from django_filters.rest_framework import DjangoFilterBackend\n+from rest_framework import filters, generics, status\n from rest_framework.permissions import IsAdminUser, IsAuthenticated\n from rest_framework.response import Response\n \n@@ -11,7 +12,8 @@\n \n class ProjectList(generics.ListCreateAPIView):\n     serializer_class = ProjectPolymorphicSerializer\n-    pagination_class = None\n+    filter_backends = (DjangoFilterBackend, filters.SearchFilter, filters.OrderingFilter)\n+    search_fields = ('name', 'description')\n \n     def get_permissions(self):\n         if self.request.method == 'GET':\n", "issue": "Pagination of the project list\nWhen fetching projects in the project list page, is it intentional that all projects are fetched at once even though there is pagination?\r\n\r\nEndpoint of project list fetching: `/v1/projects`\r\n\r\nWhen there are a lot of projects, it takes a long time to display them.\r\n\r\nYour Environment\r\n---------\r\ndoccano v1.5.5\n", "before_files": [{"content": "from django.conf import settings\nfrom rest_framework import generics, status\nfrom rest_framework.permissions import IsAdminUser, IsAuthenticated\nfrom rest_framework.response import Response\n\nfrom members.permissions import IsProjectAdmin, IsProjectStaffAndReadOnly\n\nfrom ..models import Project\nfrom ..serializers import ProjectPolymorphicSerializer\n\n\nclass ProjectList(generics.ListCreateAPIView):\n    serializer_class = ProjectPolymorphicSerializer\n    pagination_class = None\n\n    def get_permissions(self):\n        if self.request.method == 'GET':\n            self.permission_classes = [IsAuthenticated, ]\n        else:\n            self.permission_classes = [IsAuthenticated & IsAdminUser]\n        return super().get_permissions()\n\n    def get_queryset(self):\n        return Project.objects.filter(role_mappings__user=self.request.user)\n\n    def perform_create(self, serializer):\n        serializer.save(created_by=self.request.user)\n\n    def delete(self, request, *args, **kwargs):\n        delete_ids = request.data['ids']\n        projects = Project.objects.filter(\n            role_mappings__user=self.request.user,\n            role_mappings__role__name=settings.ROLE_PROJECT_ADMIN,\n            pk__in=delete_ids\n        )\n        # Todo: I want to use bulk delete.\n        # But it causes the constraint error.\n        # See https://github.com/django-polymorphic/django-polymorphic/issues/229\n        for project in projects:\n            project.delete()\n        return Response(status=status.HTTP_204_NO_CONTENT)\n\n\nclass ProjectDetail(generics.RetrieveUpdateDestroyAPIView):\n    queryset = Project.objects.all()\n    serializer_class = ProjectPolymorphicSerializer\n    lookup_url_kwarg = 'project_id'\n    permission_classes = [IsAuthenticated & (IsProjectAdmin | IsProjectStaffAndReadOnly)]\n", "path": "backend/api/views/project.py"}], "after_files": [{"content": "from django.conf import settings\nfrom django_filters.rest_framework import DjangoFilterBackend\nfrom rest_framework import filters, generics, status\nfrom rest_framework.permissions import IsAdminUser, IsAuthenticated\nfrom rest_framework.response import Response\n\nfrom members.permissions import IsProjectAdmin, IsProjectStaffAndReadOnly\n\nfrom ..models import Project\nfrom ..serializers import ProjectPolymorphicSerializer\n\n\nclass ProjectList(generics.ListCreateAPIView):\n    serializer_class = ProjectPolymorphicSerializer\n    filter_backends = (DjangoFilterBackend, filters.SearchFilter, filters.OrderingFilter)\n    search_fields = ('name', 'description')\n\n    def get_permissions(self):\n        if self.request.method == 'GET':\n            self.permission_classes = [IsAuthenticated, ]\n        else:\n            self.permission_classes = [IsAuthenticated & IsAdminUser]\n        return super().get_permissions()\n\n    def get_queryset(self):\n        return Project.objects.filter(role_mappings__user=self.request.user)\n\n    def perform_create(self, serializer):\n        serializer.save(created_by=self.request.user)\n\n    def delete(self, request, *args, **kwargs):\n        delete_ids = request.data['ids']\n        projects = Project.objects.filter(\n            role_mappings__user=self.request.user,\n            role_mappings__role__name=settings.ROLE_PROJECT_ADMIN,\n            pk__in=delete_ids\n        )\n        # Todo: I want to use bulk delete.\n        # But it causes the constraint error.\n        # See https://github.com/django-polymorphic/django-polymorphic/issues/229\n        for project in projects:\n            project.delete()\n        return Response(status=status.HTTP_204_NO_CONTENT)\n\n\nclass ProjectDetail(generics.RetrieveUpdateDestroyAPIView):\n    queryset = Project.objects.all()\n    serializer_class = ProjectPolymorphicSerializer\n    lookup_url_kwarg = 'project_id'\n    permission_classes = [IsAuthenticated & (IsProjectAdmin | IsProjectStaffAndReadOnly)]\n", "path": "backend/api/views/project.py"}]}