diff --git a/.travis.yml b/.travis.yml
index 7266df2d5..f1ec689f7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,24 +1,16 @@
language: python
cache: pip
-dist: xenial
+dist: bionic
matrix:
fast_finish: true
include:
- - { python: "3.5", env: DJANGO=1.11 }
- - { python: "3.5", env: DJANGO=2.0 }
- - { python: "3.5", env: DJANGO=2.1 }
- { python: "3.5", env: DJANGO=2.2 }
- - { python: "3.6", env: DJANGO=1.11 }
- - { python: "3.6", env: DJANGO=2.0 }
- - { python: "3.6", env: DJANGO=2.1 }
- { python: "3.6", env: DJANGO=2.2 }
- { python: "3.6", env: DJANGO=3.0 }
- { python: "3.6", env: DJANGO=master }
- - { python: "3.7", env: DJANGO=2.0 }
- - { python: "3.7", env: DJANGO=2.1 }
- { python: "3.7", env: DJANGO=2.2 }
- { python: "3.7", env: DJANGO=3.0 }
- { python: "3.7", env: DJANGO=master }
diff --git a/README.md b/README.md
index 9591bdc17..95020bb1d 100644
--- a/README.md
+++ b/README.md
@@ -55,7 +55,7 @@ There is a live example API for testing purposes, [available here][sandbox].
# Requirements
* Python (3.5, 3.6, 3.7, 3.8)
-* Django (1.11, 2.0, 2.1, 2.2, 3.0)
+* Django (2.2, 3.0)
We **highly recommend** and only officially support the latest patch release of
each Python and Django series.
@@ -89,7 +89,7 @@ Startup up a new project like so...
Now edit the `example/urls.py` module in your project:
```python
-from django.conf.urls import url, include
+from django.urls import path, include
from django.contrib.auth.models import User
from rest_framework import serializers, viewsets, routers
@@ -114,8 +114,8 @@ router.register(r'users', UserViewSet)
# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browsable API.
urlpatterns = [
- url(r'^', include(router.urls)),
- url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
+ path('', include(router.urls)),
+ path('api-auth/', include('rest_framework.urls', namespace='rest_framework'))
]
```
diff --git a/docs/api-guide/authentication.md b/docs/api-guide/authentication.md
index c4dbe8856..ebb0ab4d6 100644
--- a/docs/api-guide/authentication.md
+++ b/docs/api-guide/authentication.md
@@ -304,7 +304,7 @@ If successfully authenticated, `RemoteUserAuthentication` provides the following
Consult your web server's documentation for information about configuring an authentication method, e.g.:
* [Apache Authentication How-To](https://httpd.apache.org/docs/2.4/howto/auth.html)
-* [NGINX (Restricting Access)](https://www.nginx.com/resources/admin-guide/#restricting_access)
+* [NGINX (Restricting Access)](https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-http-basic-authentication/)
# Custom authentication
@@ -410,9 +410,15 @@ HTTP Signature (currently a [IETF draft][http-signature-ietf-draft]) provides a
[Djoser][djoser] library provides a set of views to handle basic actions such as registration, login, logout, password reset and account activation. The package works with a custom user model and it uses token based authentication. This is a ready to use REST implementation of Django authentication system.
-## django-rest-auth
+## django-rest-auth / dj-rest-auth
-[Django-rest-auth][django-rest-auth] library provides a set of REST API endpoints for registration, authentication (including social media authentication), password reset, retrieve and update user details, etc. By having these API endpoints, your client apps such as AngularJS, iOS, Android, and others can communicate to your Django backend site independently via REST APIs for user management.
+This library provides a set of REST API endpoints for registration, authentication (including social media authentication), password reset, retrieve and update user details, etc. By having these API endpoints, your client apps such as AngularJS, iOS, Android, and others can communicate to your Django backend site independently via REST APIs for user management.
+
+
+There are currently two forks of this project.
+
+* [Django-rest-auth][django-rest-auth] is the original project, [but is not currently receiving updates](https://github.com/Tivix/django-rest-auth/issues/568).
+* [Dj-rest-auth][dj-rest-auth] is a newer fork of the project.
## django-rest-framework-social-oauth2
@@ -456,6 +462,7 @@ HTTP Signature (currently a [IETF draft][http-signature-ietf-draft]) provides a
[mac]: https://tools.ietf.org/html/draft-hammer-oauth-v2-mac-token-05
[djoser]: https://github.com/sunscrapers/djoser
[django-rest-auth]: https://github.com/Tivix/django-rest-auth
+[dj-rest-auth]: https://github.com/jazzband/dj-rest-auth
[django-rest-framework-social-oauth2]: https://github.com/PhilipGarnero/django-rest-framework-social-oauth2
[django-rest-knox]: https://github.com/James1345/django-rest-knox
[drfpasswordless]: https://github.com/aaronn/django-rest-framework-passwordless
diff --git a/docs/api-guide/filtering.md b/docs/api-guide/filtering.md
index bad57b441..8e3bd9ef5 100644
--- a/docs/api-guide/filtering.md
+++ b/docs/api-guide/filtering.md
@@ -205,6 +205,10 @@ This will allow the client to filter the items in the list by making queries suc
You can also perform a related lookup on a ForeignKey or ManyToManyField with the lookup API double-underscore notation:
search_fields = ['username', 'email', 'profile__profession']
+
+For [JSONField][JSONField] and [HStoreField][HStoreField] fields you can filter based on nested values within the data structure using the same double-underscore notation:
+
+ search_fields = ['data__breed', 'data__owner__other_pets__0__name']
By default, searches will use case-insensitive partial matches. The search parameter may contain multiple search terms, which should be whitespace and/or comma separated. If multiple search terms are used then objects will be returned in the list only if all the provided terms are matched.
@@ -360,3 +364,5 @@ The [djangorestframework-word-filter][django-rest-framework-word-search-filter]
[django-rest-framework-word-search-filter]: https://github.com/trollknurr/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
diff --git a/docs/api-guide/metadata.md b/docs/api-guide/metadata.md
index fdb778626..20708c6e3 100644
--- a/docs/api-guide/metadata.md
+++ b/docs/api-guide/metadata.md
@@ -71,7 +71,7 @@ If you have specific requirements for creating schema endpoints that are accesse
For example, the following additional route could be used on a viewset to provide a linkable schema endpoint.
@action(methods=['GET'], detail=False)
- def schema(self, request):
+ def api_schema(self, request):
meta = self.metadata_class()
data = meta.determine_metadata(request, self)
return Response(data)
diff --git a/docs/api-guide/permissions.md b/docs/api-guide/permissions.md
index 25baa4813..ac2924a83 100644
--- a/docs/api-guide/permissions.md
+++ b/docs/api-guide/permissions.md
@@ -231,7 +231,7 @@ If you need to test if a request is a read operation or a write operation, you s
---
-Custom permissions will raise a `PermissionDenied` exception if the test fails. To change the error message associated with the exception, implement a `message` attribute directly on your custom permission. Otherwise the `default_detail` attribute from `PermissionDenied` will be used.
+Custom permissions will raise a `PermissionDenied` exception if the test fails. To change the error message associated with the exception, implement a `message` attribute directly on your custom permission. Otherwise the `default_detail` attribute from `PermissionDenied` will be used. Similarly, to change the code identifier associated with the exception, implement a `code` attribute directly on your custom permission - otherwise the `default_code` attribute from `PermissionDenied` will be used.
from rest_framework import permissions
diff --git a/docs/api-guide/renderers.md b/docs/api-guide/renderers.md
index a3321e860..a508a9ff9 100644
--- a/docs/api-guide/renderers.md
+++ b/docs/api-guide/renderers.md
@@ -273,7 +273,7 @@ By default this will include the following keys: `view`, `request`, `response`,
The following is an example plaintext renderer that will return a response with the `data` parameter as the content of the response.
- from django.utils.encoding import smart_unicode
+ from django.utils.encoding import smart_text
from rest_framework import renderers
@@ -282,7 +282,7 @@ The following is an example plaintext renderer that will return a response with
format = 'txt'
def render(self, data, media_type=None, renderer_context=None):
- return data.encode(self.charset)
+ return smart_text(data, encoding=self.charset)
## Setting the character set
diff --git a/docs/api-guide/schemas.md b/docs/api-guide/schemas.md
index e33a2a611..3dc3f5628 100644
--- a/docs/api-guide/schemas.md
+++ b/docs/api-guide/schemas.md
@@ -18,19 +18,19 @@ Django REST Framework provides support for automatic generation of
## Generating an OpenAPI Schema
-### Install `pyyaml`
+### Install dependencies
-You'll need to install `pyyaml`, so that you can render your generated schema
-into the commonly used YAML-based OpenAPI format.
+ pip install pyyaml uritemplate
- pip install pyyaml
+* `pyyaml` is used to generate schema into YAML-based OpenAPI format.
+* `uritemplate` is used internally to get parameters in path.
### Generating a static schema with the `generateschema` management command
If your schema is static, you can use the `generateschema` management command:
```bash
-./manage.py generateschema > openapi-schema.yml
+./manage.py generateschema --file openapi-schema.yml
```
Once you've generated a schema in this way you can annotate it with any
@@ -122,7 +122,7 @@ on a per-view basis.
### Schema Level Customization
-In order to customize the top-level schema sublass
+In order to customize the top-level schema subclass
`rest_framework.schemas.openapi.SchemaGenerator` and provide it as an argument
to the `generateschema` command or `get_schema_view()` helper function.
@@ -215,6 +215,180 @@ This also applies to extra actions for `ViewSet`s:
If you wish to provide a base `AutoSchema` subclass to be used throughout your
project you may adjust `settings.DEFAULT_SCHEMA_CLASS` appropriately.
+
+### Grouping Operations With Tags
+
+Tags can be used to group logical operations. Each tag name in the list MUST be unique.
+
+---
+#### Django REST Framework generates tags automatically with the following logic:
+
+Tag name will be first element from the path. Also, any `_` in path name will be replaced by a `-`.
+Consider below examples.
+
+Example 1: Consider a user management system. The following table will illustrate the tag generation logic.
+Here first element from the paths is: `users`. Hence tag wil be `users`
+
+Http Method | Path | Tags
+-------------------------------------|-------------------|-------------
+PUT, PATCH, GET(Retrieve), DELETE | /users/{id}/ | ['users']
+POST, GET(List) | /users/ | ['users']
+
+Example 2: Consider a restaurant management system. The System has restaurants. Each restaurant has branches.
+Consider REST APIs to deal with a branch of a particular restaurant.
+Here first element from the paths is: `restaurants`. Hence tag wil be `restaurants`.
+
+Http Method | Path | Tags
+-------------------------------------|----------------------------------------------------|-------------------
+PUT, PATCH, GET(Retrieve), DELETE: | /restaurants/{restaurant_id}/branches/{branch_id} | ['restaurants']
+POST, GET(List): | /restaurants/{restaurant_id}/branches/ | ['restaurants']
+
+Example 3: Consider Order items for an e commerce company.
+
+Http Method | Path | Tags
+-------------------------------------|-------------------------|-------------
+PUT, PATCH, GET(Retrieve), DELETE | /order_items/{id}/ | ['order-items']
+POST, GET(List) | /order_items/ | ['order-items']
+
+
+---
+#### Overriding auto generated tags:
+You can override auto-generated tags by passing `tags` argument to the constructor of `AutoSchema`. `tags` argument must be a list or tuple of string.
+```python
+from rest_framework.schemas.openapi import AutoSchema
+from rest_framework.views import APIView
+
+class MyView(APIView):
+ schema = AutoSchema(tags=['tag1', 'tag2'])
+ ...
+```
+
+If you need more customization, you can override the `get_tags` method of `AutoSchema` class. Consider the following example:
+
+```python
+from rest_framework.schemas.openapi import AutoSchema
+from rest_framework.views import APIView
+
+class MySchema(AutoSchema):
+ ...
+ def get_tags(self, path, method):
+ if method == 'POST':
+ tags = ['tag1', 'tag2']
+ elif method == 'GET':
+ tags = ['tag2', 'tag3']
+ elif path == '/example/path/':
+ tags = ['tag3', 'tag4']
+ else:
+ tags = ['tag5', 'tag6', 'tag7']
+
+ return tags
+
+class MyView(APIView):
+ schema = MySchema()
+ ...
+```
+
+### OperationId
+
+The schema generator generates an [operationid][openapi-operationid] for each operation. This `operationId` is deduced from the model name, serializer name or view name. The operationId may looks like "listItems", "retrieveItem", "updateItem", etc..
+The `operationId` is camelCase by convention.
+
+If you have several views with the same model, the generator may generate duplicate operationId.
+In order to work around this, you can override the second part of the operationId: operation name.
+
+```python
+from rest_framework.schemas.openapi import AutoSchema
+
+class ExampleView(APIView):
+ """APIView subclass with custom schema introspection."""
+ schema = AutoSchema(operation_id_base="Custom")
+```
+
+The previous example will generate the following operationId: "listCustoms", "retrieveCustom", "updateCustom", "partialUpdateCustom", "destroyCustom".
+You need to provide the singular form of he operation name. For the list operation, a "s" will be appended at the end of the operation.
+
+If you need more configuration over the `operationId` field, you can override the `get_operation_id_base` and `get_operation_id` methods from the `AutoSchema` class:
+
+```python
+class CustomSchema(AutoSchema):
+ def get_operation_id_base(self, path, method, action):
+ pass
+
+ def get_operation_id(self, path, method):
+ pass
+
+class MyView(APIView):
+ schema = AutoSchema(component_name="Ulysses")
+```
+
+### Components
+
+Since DRF 3.12, Schema uses the [OpenAPI Components][openapi-components]. This method defines components in the schema and [references them][openapi-reference] inside request and response objects. By default, the component's name is deduced from the Serializer's name.
+
+Using OpenAPI's components provides the following advantages:
+
+* The schema is more readable and lightweight.
+* If you use the schema to generate an SDK (using [openapi-generator][openapi-generator] or [swagger-codegen][swagger-codegen]). The generator can name your SDK's models.
+
+### Handling component's schema errors
+
+You may get the following error while generating the schema:
+```
+"Serializer" is an invalid class name for schema generation.
+Serializer's class name should be unique and explicit. e.g. "ItemSerializer".
+```
+
+This error occurs when the Serializer name is "Serializer". You should choose a component's name unique across your schema and different than "Serializer".
+
+You may also get the following warning:
+```
+Schema component "ComponentName" has been overriden with a different value.
+```
+
+This warning occurs when different components have the same name in one schema. Your component name should be unique across your project. This is likely an error that may lead to an invalid schema.
+
+You have two ways to solve the previous issues:
+
+* You can rename your serializer with a unique name and another name than "Serializer".
+* You can set the `component_name` kwarg parameter of the AutoSchema constructor (see below).
+* You can override the `get_component_name` method of the AutoSchema class (see below).
+
+#### Set a custom component's name for your view
+
+To override the component's name in your view, you can use the `component_name` parameter of the AutoSchema constructor:
+
+```python
+from rest_framework.schemas.openapi import AutoSchema
+
+class MyView(APIView):
+ schema = AutoSchema(component_name="Ulysses")
+```
+
+#### Override the default implementation
+
+If you want to have more control and customization about how the schema's components are generated, you can override the `get_component_name` and `get_components` method from the AutoSchema class.
+
+```python
+from rest_framework.schemas.openapi import AutoSchema
+
+class CustomSchema(AutoSchema):
+ def get_components(self, path, method):
+ # Implement your custom implementation
+
+ def get_component_name(self, serializer):
+ # Implement your custom implementation
+
+class CustomView(APIView):
+ """APIView subclass with custom schema introspection."""
+ schema = CustomSchema()
+```
+
[openapi]: https://github.com/OAI/OpenAPI-Specification
[openapi-specification-extensions]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#specification-extensions
[openapi-operation]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#operationObject
+[openapi-tags]: https://swagger.io/specification/#tagObject
+[openapi-operationid]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#fixed-fields-17
+[openapi-components]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#componentsObject
+[openapi-reference]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#referenceObject
+[openapi-generator]: https://github.com/OpenAPITools/openapi-generator
+[swagger-codegen]: https://github.com/swagger-api/swagger-codegen
diff --git a/docs/api-guide/serializers.md b/docs/api-guide/serializers.md
index 4679b1ed1..87d3d4056 100644
--- a/docs/api-guide/serializers.md
+++ b/docs/api-guide/serializers.md
@@ -238,10 +238,12 @@ Serializer classes can also include reusable validators that are applied to the
class Meta:
# Each room only has one event per day.
- validators = UniqueTogetherValidator(
- queryset=Event.objects.all(),
- fields=['room_number', 'date']
- )
+ validators = [
+ UniqueTogetherValidator(
+ queryset=Event.objects.all(),
+ fields=['room_number', 'date']
+ )
+ ]
For more information see the [validators documentation](validators.md).
@@ -333,7 +335,7 @@ Here's an example for an `.update()` method on our previous `UserSerializer` cla
def update(self, instance, validated_data):
profile_data = validated_data.pop('profile')
# Unless the application properly enforces that this field is
- # always set, the follow could raise a `DoesNotExist`, which
+ # always set, the following could raise a `DoesNotExist`, which
# would need to be handled.
profile = instance.profile
@@ -382,8 +384,8 @@ This manager class now more nicely encapsulates that user instances and profile
def create(self, validated_data):
return User.objects.create(
username=validated_data['username'],
- email=validated_data['email']
- is_premium_member=validated_data['profile']['is_premium_member']
+ email=validated_data['email'],
+ is_premium_member=validated_data['profile']['is_premium_member'],
has_support_contract=validated_data['profile']['has_support_contract']
)
diff --git a/docs/api-guide/testing.md b/docs/api-guide/testing.md
index dab0e264d..73de68a76 100644
--- a/docs/api-guide/testing.md
+++ b/docs/api-guide/testing.md
@@ -221,7 +221,7 @@ If you're using `RequestsClient` you'll want to ensure that test setup, and resu
## Headers & Authentication
Custom headers and authentication credentials can be provided in the same way
-as [when using a standard `requests.Session` instance](http://docs.python-requests.org/en/master/user/advanced/#session-objects).
+as [when using a standard `requests.Session` instance][session_objects].
from requests.auth import HTTPBasicAuth
@@ -414,3 +414,4 @@ For example, to add support for using `format='html'` in test requests, you migh
[requestfactory]: https://docs.djangoproject.com/en/stable/topics/testing/advanced/#django.test.client.RequestFactory
[configuration]: #configuration
[refresh_from_db_docs]: https://docs.djangoproject.com/en/1.11/ref/models/instances/#django.db.models.Model.refresh_from_db
+[session_objects]: https://requests.readthedocs.io/en/master/user/advanced/#session-objects
diff --git a/docs/api-guide/viewsets.md b/docs/api-guide/viewsets.md
index cd765d3e6..d7aa7ad3b 100644
--- a/docs/api-guide/viewsets.md
+++ b/docs/api-guide/viewsets.md
@@ -317,5 +317,5 @@ To create a base viewset class that provides `create`, `list` and `retrieve` ope
By creating your own base `ViewSet` classes, you can provide common behavior that can be reused in multiple viewsets across your API.
-[cite]: https://guides.rubyonrails.org/routing.html
+[cite]: https://guides.rubyonrails.org/action_controller_overview.html
[routers]: routers.md
diff --git a/docs/community/release-notes.md b/docs/community/release-notes.md
index 4be05d56b..0e634aa1e 100644
--- a/docs/community/release-notes.md
+++ b/docs/community/release-notes.md
@@ -34,10 +34,32 @@ You can determine your currently installed version using `pip show`:
---
+## 3.11.x series
+
+### 3.11.0
+
+**Date**: 12th December 2019
+
+* Drop `.set_context` API [in favour of a `requires_context` marker](../3.11-announcement#validator-default-context).
+* Changed default widget for TextField with choices to select box. [#6892][gh6892]
+* Supported nested writes on non-relational fields, such as JSONField. [#6916][gh6916]
+* Include request/response media types in OpenAPI schemas, based on configured parsers/renderers. [#6865][gh6865]
+* Include operation descriptions in OpenAPI schemas, based on the docstring on the view. [#6898][gh6898]
+* Fix representation of serializers with all optional fields in OpenAPI schemas. [#6941][gh6941], [#6944][gh6944]
+* Fix representation of `serializers.HStoreField` in OpenAPI schemas. [#6914][gh6914]
+* Fix OpenAPI generation when title or version is not provided. [#6912][gh6912]
+* Use `int64` representation for large integers in OpenAPI schemas. [#7018][gh7018]
+* Improved error messages if no `.to_representation` implementation is provided on a field subclass. [#6996][gh6996]
+* Fix for serializer classes that use multiple inheritance. [#6980][gh6980]
+* Fix for reversing Hyperlinked URL fields with percent encoded components in the path. [#7059][gh7059]
+* Update bootstrap to 3.4.1. [#6923][gh6923]
+
## 3.10.x series
### 3.10.3
+**Date**: 4th September 2019
+
* Include API version in OpenAPI schema generation, defaulting to empty string.
* Add pagination properties to OpenAPI response schemas.
* Add missing "description" property to OpenAPI response schemas.
@@ -47,9 +69,7 @@ You can determine your currently installed version using `pip show`:
* Use consistent `lowerInitialCamelCase` style in OpenAPI operation IDs.
* Fix `minLength`/`maxLength`/`minItems`/`maxItems` properties in OpenAPI schemas.
* Only call `FileField.url` once in serialization, for improved performance.
-* Fix an edge case where throttling calcualtions could error after a configuration change.
-
-* TODO
+* Fix an edge case where throttling calculations could error after a configuration change.
### 3.10.2
@@ -154,7 +174,7 @@ Be sure to upgrade to Python 3 before upgrading to Django REST Framework 3.10.
* Add testing of Python 3.7 support [#6141][gh6141]
* Test using Django 2.1 final release. [#6109][gh6109]
* Added djangorestframework-datatables to third-party packages [#5931][gh5931]
-* Change ISO 8601 date format to exclude year/month [#5936][gh5936]
+* Change ISO 8601 date format to exclude year/month-only options [#5936][gh5936]
* Update all pypi.python.org URLs to pypi.org [#5942][gh5942]
* Ensure that html forms (multipart form data) respect optional fields [#5927][gh5927]
* Allow hashing of ErrorDetail. [#5932][gh5932]
@@ -2175,3 +2195,18 @@ For older release notes, [please see the version 2.x documentation][old-release-
[gh6680]: https://github.com/encode/django-rest-framework/issues/6680
[gh6317]: https://github.com/encode/django-rest-framework/issues/6317
+
+
+[gh6892]: https://github.com/encode/django-rest-framework/issues/6892
+[gh6916]: https://github.com/encode/django-rest-framework/issues/6916
+[gh6865]: https://github.com/encode/django-rest-framework/issues/6865
+[gh6898]: https://github.com/encode/django-rest-framework/issues/6898
+[gh6941]: https://github.com/encode/django-rest-framework/issues/6941
+[gh6944]: https://github.com/encode/django-rest-framework/issues/6944
+[gh6914]: https://github.com/encode/django-rest-framework/issues/6914
+[gh6912]: https://github.com/encode/django-rest-framework/issues/6912
+[gh7018]: https://github.com/encode/django-rest-framework/issues/7018
+[gh6996]: https://github.com/encode/django-rest-framework/issues/6996
+[gh6980]: https://github.com/encode/django-rest-framework/issues/6980
+[gh7059]: https://github.com/encode/django-rest-framework/issues/7059
+[gh6923]: https://github.com/encode/django-rest-framework/issues/6923
diff --git a/docs/community/third-party-packages.md b/docs/community/third-party-packages.md
index baa30fd0c..2033d97ab 100644
--- a/docs/community/third-party-packages.md
+++ b/docs/community/third-party-packages.md
@@ -223,6 +223,7 @@ To submit new content, [open an issue][drf-create-issue] or [create a pull reque
### Views
* [django-rest-multiple-models][django-rest-multiple-models] - Provides a generic view (and mixin) for sending multiple serialized models and/or querysets via a single API request.
+* [drf-typed-views][drf-typed-views] - Use Python type annotations to validate/deserialize request parameters. Inspired by API Star, Hug and FastAPI.
### Routers
@@ -272,6 +273,7 @@ To submit new content, [open an issue][drf-create-issue] or [create a pull reque
* [djangorestframework-mvt][djangorestframework-mvt] - An extension for creating views that serve Postgres data as Map Box Vector Tiles.
* [drf-viewset-profiler][drf-viewset-profiler] - Lib to profile all methods from a viewset line by line.
* [djangorestframework-features][djangorestframework-features] - Advanced schema generation and more based on named features.
+* [django-elasticsearch-dsl-drf][django-elasticsearch-dsl-drf] - Integrate Elasticsearch DSL with Django REST framework. Package provides views, serializers, filter backends, pagination and other handy add-ons.
[cite]: http://www.software-ecosystems.com/Software_Ecosystems/Ecosystems.html
[cookiecutter]: https://github.com/jpadilla/cookiecutter-django-rest-framework
@@ -347,6 +349,7 @@ To submit new content, [open an issue][drf-create-issue] or [create a pull reque
[django-rest-witchcraft]: https://github.com/shosca/django-rest-witchcraft
[drf-access-policy]: https://github.com/rsinger86/drf-access-policy
[drf-flex-fields]: https://github.com/rsinger86/drf-flex-fields
+[drf-typed-views]: https://github.com/rsinger86/drf-typed-views
[drf-action-serializer]: https://github.com/gregschmit/drf-action-serializer
[djangorestframework-dataclasses]: https://github.com/oxan/djangorestframework-dataclasses
[django-restql]: https://github.com/yezyilomo/django-restql
@@ -354,3 +357,4 @@ To submit new content, [open an issue][drf-create-issue] or [create a pull reque
[django-rest-framework-guardian]: https://github.com/rpkilby/django-rest-framework-guardian
[drf-viewset-profiler]: https://github.com/fvlima/drf-viewset-profiler
[djangorestframework-features]: https://github.com/cloudcode-hungary/django-rest-framework-features/
+[django-elasticsearch-dsl-drf]: https://github.com/barseghyanartur/django-elasticsearch-dsl-drf
diff --git a/docs/community/tutorials-and-resources.md b/docs/community/tutorials-and-resources.md
index 7993f54fb..6fdac6004 100644
--- a/docs/community/tutorials-and-resources.md
+++ b/docs/community/tutorials-and-resources.md
@@ -11,8 +11,8 @@ There are a wide range of resources available for learning and using Django REST
-
-
+
+
diff --git a/docs/img/books/dfa-cover.jpg b/docs/img/books/dfa-cover.jpg
new file mode 100644
index 000000000..09ed268f2
Binary files /dev/null and b/docs/img/books/dfa-cover.jpg differ
diff --git a/docs/img/books/rad-cover.png b/docs/img/books/rad-cover.png
deleted file mode 100644
index 75b19df64..000000000
Binary files a/docs/img/books/rad-cover.png and /dev/null differ
diff --git a/docs/index.md b/docs/index.md
index bccc1fb46..0e5f9dc7e 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -86,14 +86,14 @@ continued development by **[signing up for a paid plan][funding]**.
REST framework requires the following:
* Python (3.5, 3.6, 3.7, 3.8)
-* Django (1.11, 2.0, 2.1, 2.2, 3.0)
+* Django (2.2, 3.0)
We **highly recommend** and only officially support the latest patch release of
each Python and Django series.
The following packages are optional:
-* [coreapi][coreapi] (1.32.0+) - Schema generation support.
+* [PyYAML][pyyaml], [uritemplate][uriteemplate] (5.1+, 3.0.0+) - Schema generation support.
* [Markdown][markdown] (3.0.0+) - Markdown support for the browsable API.
* [Pygments][pygments] (2.4.0+) - Add syntax highlighting to Markdown processing.
* [django-filter][django-filter] (1.0.1+) - Filtering support.
@@ -148,7 +148,7 @@ Don't forget to make sure you've also added `rest_framework` to your `INSTALLED_
We're ready to create our API now.
Here's our project's root `urls.py` module:
- from django.conf.urls import url, include
+ from django.urls import path, include
from django.contrib.auth.models import User
from rest_framework import routers, serializers, viewsets
@@ -170,8 +170,8 @@ Here's our project's root `urls.py` module:
# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browsable API.
urlpatterns = [
- url(r'^', include(router.urls)),
- url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
+ path('', include(router.urls)),
+ path('api-auth/', include('rest_framework.urls', namespace='rest_framework'))
]
You can now open the API in your browser at [http://127.0.0.1:8000/](http://127.0.0.1:8000/), and view your new 'users' API. If you use the login control in the top right corner you'll also be able to add, create and delete users from the system.
@@ -237,7 +237,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[redhat]: https://www.redhat.com/
[heroku]: https://www.heroku.com/
[eventbrite]: https://www.eventbrite.co.uk/about/
-[coreapi]: https://pypi.org/project/coreapi/
+[pyyaml]: https://pypi.org/project/PyYAML/
+[uriteemplate]: https://pypi.org/project/uritemplate/
[markdown]: https://pypi.org/project/Markdown/
[pygments]: https://pypi.org/project/Pygments/
[django-filter]: https://pypi.org/project/django-filter/
diff --git a/docs/tutorial/quickstart.md b/docs/tutorial/quickstart.md
index 505f7f91d..546144670 100644
--- a/docs/tutorial/quickstart.md
+++ b/docs/tutorial/quickstart.md
@@ -137,12 +137,12 @@ Finally, we're including default login and logout views for use with the browsab
## Pagination
Pagination allows you to control how many objects per page are returned. To enable it add the following lines to `tutorial/settings.py`
-
+
REST_FRAMEWORK = {
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
'PAGE_SIZE': 10
}
-
+
## Settings
Add `'rest_framework'` to `INSTALLED_APPS`. The settings module will be in `tutorial/settings.py`
@@ -224,5 +224,5 @@ If you want to get a more in depth understanding of how REST framework fits toge
[image]: ../img/quickstart.png
[tutorial]: 1-serialization.md
-[guide]: ../#api-guide
+[guide]: ../api-guide/requests.md
[httpie]: https://github.com/jakubroztocil/httpie#installation
diff --git a/docs_theme/404.html b/docs_theme/404.html
index a89c0a418..bbb6b70ff 100644
--- a/docs_theme/404.html
+++ b/docs_theme/404.html
@@ -4,6 +4,6 @@