django_filters install
- Install django_filters using pip:
pip install django-filters
- Add
'django_filters'
to theINSTALLED_APPS
setting in your Django project's settings.py file:
INSTALLED_APPS = [
# ...
'django_filters',
]
- Run the
makemigrations
andmigrate
commands to create the necessary database tables for django_filters:
python manage.py makemigrations
python manage.py migrate
- Use django_filters in your Django views or serializers to filter querysets based on specified filters.