Как добавить пагинацию в представления фильтра Django?

Фильтрация и пагинация в Django Я хочу добавить пагинацию в функции просмотра фильтра ниже приведен мой код Filters.py : когда я добавляю paginated by недоступен на страницах

class AccountFilter(django_filters.FilterSet):
      username = django_filters.CharFilter(lookup_expr='icontains')
      first_name = django_filters.CharFilter(lookup_expr='icontains')
      last_name = django_filters.CharFilter(lookup_expr='icontains')
      is_staff = django_filters.BooleanFilter(widget=CustomBooleanWidget)
      is_superuser = django_filters.BooleanFilter(widget=CustomBooleanWidget)
      is_active = django_filters.BooleanFilter(widget=CustomBooleanWidget)
      date_joined = django_filters.DateFromToRangeFilter(label='Date Joined Range',                                      
      widget=django_filters.widgets.RangeWidget(attrs={'placeholder': 'yyyy/mm/dd','class':                 
      'datepicker', 'type': 'date'})) `

views.py :

# AccountFilter View:    
  def AccountViewFilter(request):
      userf_list = User.objects.all()
      userf_filter = AccountFilter(request.GET, queryset= userf_list)
      return render(request, 'accounts/user_list.html', {'filter': userf_filter})

user_list.html:

{% if filter.qs%}
<table class="table">
<thead class="thead-dark">
  <tr>
    {# <th scope="col">No</th> #}
    <th scope="col">User Name</th>
    <th scope="col">User Email</th>
    <th scope="col">Is Staff</th>
    <th scope="col">Is Active</th>
    <th scope="col">Date Joined</th>
    <th scope="col">Is SuperUser</th>
    <th scope="col">Edit</th>
    <th scope="col">Delete</th>
  </tr>
</thead>
<tbody>

{{endif}}

Вернуться на верх