def products(request):
product = Products_Table.objects.order_by('id')
categories = Category.objects.all()
tags = Product_Tags.objects.all()
paginator = Paginator(product,3)
page_number = 1
if request.method == 'POST':
data = json.loads(request.body)
page_number = data.get('page')
print(page_number)
productFinal = paginator.get_page(page_number)
for i in productFinal:
print(i)
total_pages = paginator.num_pages
context = {
'product': productFinal,
'categories': categories,
'tags': tags,
'total_pages': total_pages,
'curr': page_number
}
context.update(cart_items(request))
return render(request,'products/productlist.html',context)
the request for getting a specific page is coming to the server with the page number gets the products and returning but in the html the products are not updating