I am working on a website whose back-end is in Django and front-end is developed using React. I want to add the pagination feature in the website but don't know how it will be implemented in the frontend part.
I want to send the total page count to the react app.
I have written the following code in my views function till now
def index(request):
influencers = Influencer.objects.all()
paginator = Paginator(influencers,16)
page = request.GET.get('page')
paged_listings = paginator.get_page(page)
user_list = UserList.objects.all().filter(user_id = request.user.id)
queryset = list(chain(paged_listings,user_list),paginator.count)
ser_query = serializers.serialize('json', queryset)
return HttpResponse(ser_query)
Also I am not using REST framework to develop the back-end site.
I want to know what information I have to send to the React front-end site for this to work. How should I proceed?