From 9b1474e46aa16019d2472af8e071df54a9d109ff Mon Sep 17 00:00:00 2001 From: Oliver Sauder Date: Tue, 20 Jul 2021 22:37:49 +0400 Subject: [PATCH] Documented how to add DJA to installed apps This setting is now needed for browsable api and openapi schema. There might be more features coming needing this and it is also common practice to do this for django apps. --- README.rst | 18 ++++++++++++++---- docs/getting-started.md | 14 ++++++++++++-- docs/usage.md | 2 +- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index 03f9d52a..3487a96f 100644 --- a/README.rst +++ b/README.rst @@ -100,8 +100,7 @@ Generally Python and Django series are supported till the official end of life. Installation ------------ -From PyPI -^^^^^^^^^ +Install using ``pip``... :: @@ -112,8 +111,7 @@ From PyPI $ pip install djangorestframework-jsonapi['openapi'] -From Source -^^^^^^^^^^^ +or from source... :: @@ -122,6 +120,18 @@ From Source $ pip install -e . +and add ``rest_framework_json_api`` to your ``INSTALLED_APPS`` setting below ``rest_framework``. + +:: + + INSTALLED_APPS = [ + ... + 'rest_framework', + 'rest_framework_json_api', + ... + ] + + Running the example app ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/getting-started.md b/docs/getting-started.md index 5e374b30..debef71b 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -61,7 +61,7 @@ Generally Python and Django series are supported till the official end of life. ## Installation -From PyPI +Install using `pip`... pip install djangorestframework-jsonapi # for optional package integrations @@ -69,11 +69,21 @@ From PyPI pip install djangorestframework-jsonapi['django-polymorphic'] pip install djangorestframework-jsonapi['openapi'] -From Source +or from source... git clone https://github.com/django-json-api/django-rest-framework-json-api.git cd django-rest-framework-json-api && pip install -e . + +and add `rest_framework_json_api` to your `INSTALLED_APPS` setting below `rest_framework`. + + INSTALLED_APPS = [ + ... + 'rest_framework', + 'rest_framework_json_api', + ... + ] + ## Running the example app git clone https://github.com/django-json-api/django-rest-framework-json-api.git diff --git a/docs/usage.md b/docs/usage.md index 1e45976b..e6109713 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -998,7 +998,7 @@ The `prefetch_related` case will issue 4 queries, but they will be small and fas ## Generating an OpenAPI Specification (OAS) 3.0 schema document -DRF >= 3.12 has a [new OAS schema functionality](https://www.django-rest-framework.org/api-guide/schemas/) to generate an +DRF has a [OAS schema functionality](https://www.django-rest-framework.org/api-guide/schemas/) to generate an [OAS 3.0 schema](https://www.openapis.org/) as a YAML or JSON file. DJA extends DRF's schema support to generate an OAS schema in the JSON:API format.