1

i have a django project and it includes pagination i do not know where is the error in my code but once i tired to go to the next or previous page it crash and display the below error :

can only concatenate str(not ""NoneType) to str

        query=request.GET.get("search")
        paginator = Paginator(queryset_list, 5) 
        page_request_var = "page"
        print("page_request_var===>",page_request_var)
        page = request.GET.get(page_request_var)
        print("page===>",page)
        queryset = paginator.get_page(page)
        print("queryset===>",queryset)

When i print page it display None

In the browser it suppose to display page=2&search=sam but instead it display /?=2&20search%20=%20sam

Dev Dj
  • 169
  • 2
  • 14

1 Answers1

-2

I suggest doing something like the below two links. The first link is best practices for large datasets.

1.how-organize-pagination-with-a-large-number-of-pages-in-django

2.pagination

Riyas Ac
  • 1,553
  • 1
  • 9
  • 23