DEV Community

MahfuzKhandaker
MahfuzKhandaker

Posted on

How I use jquery ajax pagination in my django blog Project?

I would like to implement pagination in django using jquery ajax. Here is my views.py like that:

from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from .models import blog
def home(request):
    blogs = blog.objects.all()
    page = request.GET.get('page', 1)
    paginator = Paginator(blogs, 5) #number of blogs you want to paginate
    try:
        blogs =
…

Top comments (0)