Pagination with django filters?

  • 0
    Hello!
    It was necessary to make filters for QuerySet based on the GET parameters of the request that are sent by the form. But the trouble is that there is pagination, which, it is desirable, to bind to GET parameters too. For the first page, the filters work and the URL looks like this:

    http://site.ru/category/?filter=value

    When you go to the second page, the filters, of course, go astray:

    http://site.ru/category/?page=2

    And I would like the filters to remain:

    http://site.ru/category/?page=2&filter=value

    Is there any more or less concise (possibly already built-in) solution?
    Stackoverflow and others recommend very ugly solutions.
    Django Anonymous, Jun 13, 2019

  • 1 Answers
  • 0
    Good old django-pagination will save, despite the fact that five years not updated :)
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!