Django: Multiple Pagination in a single Template

Assuming you would like to display two models in the same template each with their own pagination, here’s how to do it. views.py def myview(): Model_one = Model.objects.all() paginator = Paginator(Model_one, 6) page = request.GET.get(‘page1’) try: Model_one = paginator.page(page) except PageNotAnInteger: Model_one = paginator.page(1) except EmptyPage: Model_one = paginator.page(paginator.num_pages) Model_two = Model_other.objects.all() paginator = Paginator(Model_two,…Read More