Question

I am new to django and i am using django pagination to add pagination inside my html page.My problem is i want to use pagination to paginate different table rows, but when i add the template tags for autopagination the prev/next/and pages get displayed but on selecting the next page it is redirected to another page(where a list referenced before assignment error pops up). I want the next button to display the next set of 20 entries, and not go to any html page.What should i do?

Was it helpful?

Solution

With the limited information provided in the question I can only provide two possible causes for the error:

  1. Your urls.py configuration is sending the page somewhere else.
  2. You are constructing the list to be rendered in the template with pagination. And the logic which constructs the list is probably present inside a conditional statement (if, try etc) and is not being executed. Hence the error 'list referenced before assignment'.

Please share some more information, code snippets and error logs would be better.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top