From 552ae5ac10dd5c9bf6f3ab5c7ab0533ac01d603b Mon Sep 17 00:00:00 2001 From: johnthagen Date: Mon, 14 Sep 2020 13:01:45 -0400 Subject: [PATCH 1/2] Make it more clear to add django_filters to INSTALLED_APPS --- docs/api-guide/filtering.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/api-guide/filtering.md b/docs/api-guide/filtering.md index 41c1341ddf..34192cdc46 100644 --- a/docs/api-guide/filtering.md +++ b/docs/api-guide/filtering.md @@ -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 = { @@ -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 \ No newline at end of file +[JSONField]: https://docs.djangoproject.com/en/3.0/ref/contrib/postgres/fields/#jsonfield From f5b746eddffc22100aae54d336dcd348d154734f Mon Sep 17 00:00:00 2001 From: johnthagen Date: Mon, 14 Sep 2020 13:04:04 -0400 Subject: [PATCH 2/2] Quote string value --- docs/api-guide/filtering.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-guide/filtering.md b/docs/api-guide/filtering.md index 34192cdc46..d305ede6ba 100644 --- a/docs/api-guide/filtering.md +++ b/docs/api-guide/filtering.md @@ -149,7 +149,7 @@ To use `DjangoFilterBackend`, first install `django-filter`. pip install django-filter -Then add `django_filters` to Django's `INSTALLED_APPS`: +Then add `'django_filters'` to Django's `INSTALLED_APPS`: INSTALLED_APPS = [ ...