Since this is a broad question, I would like to combine several pagination solutions now.
1. Use a generic ListView :
from django.views.generic import ListView class EntryList(ListView): model = Entry template_name = 'blog/entry_list.html' context_object_name = 'entry_list' paginate_by = 10
This will be faster using only urls.py :
url(r'^entries/$', ListView.as_view(model=Entry, paginate_by=10))
So in this solution you do not need django-infinite breakdown. Here you can check out an example template: How to use pagination with Django-based generic ListViews?
2.Use django-endless-pagination AjaxListView :
from endless_pagination.views import AjaxListView class EntryList(AjaxListView): model = Entry context_object_name = 'entry_list' page_template = 'entry.html'
Or faster (again) with urls.py only:
from endless_pagination.views import AjaxListView url(r'^entries/$', AjaxListView.as_view(model=Entry))
Link: http://django-endless-pagination.readthedocs.org/en/latest/generic_views.html
If someone knows a different solution, please comment.
source share