Skip to content

Commit e17779c

Browse files
authored
Make it more clear to add django_filters to INSTALLED_APPS in docs. (encode#7535)
1 parent 04f39c4 commit e17779c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docs/api-guide/filtering.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,18 @@ Note that you can use both an overridden `.get_queryset()` and generic filtering
145145
The [`django-filter`][django-filter-docs] library includes a `DjangoFilterBackend` class which
146146
supports highly customizable field filtering for REST framework.
147147

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

150150
pip install django-filter
151151

152+
Then add `'django_filters'` to Django's `INSTALLED_APPS`:
153+
154+
INSTALLED_APPS = [
155+
...
156+
'django_filters',
157+
...
158+
]
159+
152160
You should now either add the filter backend to your settings:
153161

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

0 commit comments

Comments
 (0)