You can define the _count variable in your paginator
paginator = Paginator(QuerySet, 300) paginator._count = 9000
And here is the part of the django paginator code that will help you understand what this variable does and how the page counter works
def _get_count(self): "Returns the total number of objects, across all pages." if self._count is None: try: self._count = self.object_list.count() except (AttributeError, TypeError):
errx
source share