django-filter use paginations

This worked for me: in my template instead of using this <li><a href=”https://stackoverflow.com/questions/44048156/?page={{ i }}”>{{ i }}</a></li> I wrote this: {% if ‘whatever_parameter_you_use_to_filter’ in request.get_full_path %} <li><a href=”https://stackoverflow.com/questions/44048156/{{ request.get_full_path }}&page={{ i }}”{{ i }}</a></li> {% else %} <li><a href=”https://stackoverflow.com/questions/44048156/?page={{ i }}”>{{ i }}</a></li> {% endif %} I hope it helps 🙂

How do you use the django-filter package with a list of parameters?

I know it is an old question, but might be worth it to give an updated answer. Django-filter contributors have added a field called BaseInFilter which you can combine with other filters to validate the content. See the docs: https://django-filter.readthedocs.io/en/latest/ref/filters.html#baseinfilter For example, this would work in your case: from django_filters import rest_framework as filters class … Read more