How to use django-filter with class views?

A few years ago, Vitor made a nice tutorial on using django-filter. https://simpleisbetterthancomplex.com/tutorial/2016/11/28/how-to-filter-querysets-dynamically.html Unfortunately, it doesn’t address how to use django-filter with class-based views.

My question is not unlike this one on stackoverflow: https://stackoverflow.com/questions/59480402/how-to-use-django-filter-with-a-listview-class-view-for-search

I’ve searched all over for a simple example of django-filter with class-based views, but even the official documentation doesn’t have a complete example.

Any ideas? :smile:

Project documentation shows you how to:

https://django-filter.readthedocs.io/en/master/guide/usage.html#generic-view-configuration

Also you can just implement filterin at get_queryset method of your GenericListView