Skip to content

Commit

Permalink
Make it more clear to add django_filters to INSTALLED_APPS in docs. (e…
Browse files Browse the repository at this point in the history
  • Loading branch information
johnthagen authored and sigvef committed Dec 3, 2022
1 parent 34601f9 commit a04b62e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions docs/api-guide/filtering.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,18 @@ Note that you can use both an overridden `.get_queryset()` and generic filtering
The [`django-filter`][django-filter-docs] library includes a `DjangoFilterBackend` class which
supports highly customizable field filtering for REST framework.

To use `DjangoFilterBackend`, first install `django-filter`. Then add `django_filters` to Django's `INSTALLED_APPS`
To use `DjangoFilterBackend`, first install `django-filter`.

pip install django-filter

Then add `'django_filters'` to Django's `INSTALLED_APPS`:

INSTALLED_APPS = [
...
'django_filters',
...
]

You should now either add the filter backend to your settings:

REST_FRAMEWORK = {
Expand Down Expand Up @@ -365,4 +373,4 @@ The [djangorestframework-word-filter][django-rest-framework-word-search-filter]
[django-url-filter]: https://github.com/miki725/django-url-filter
[drf-url-filter]: https://github.com/manjitkumar/drf-url-filters
[HStoreField]: https://docs.djangoproject.com/en/3.0/ref/contrib/postgres/fields/#hstorefield
[JSONField]: https://docs.djangoproject.com/en/3.0/ref/contrib/postgres/fields/#jsonfield
[JSONField]: https://docs.djangoproject.com/en/3.0/ref/contrib/postgres/fields/#jsonfield

0 comments on commit a04b62e

Please sign in to comment.