Skip to content

Version 3.10 #6802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CHANGELOG.md

This file was deleted.

95 changes: 62 additions & 33 deletions docs/community/3.10-announcement.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,45 @@

# Django REST framework 3.10

## Python 3 Only.

* Reworked OpenAPI schema generation.
* Python 3 only.
The 3.10 release is our first to drop support for Python 2.

Our supported Python versions are currently 3.5, 3.6, and 3.7.

Our support Django versions are currently 1.11, 2.0, 2.1, and 2.2.

## OpenAPI Schema Generation.

Since we first introduced schema support in Django REST Framework 3.5, OpenAPI has emerged as the widely adopted standard for modelling Web APIs.
Since we first introduced schema support in Django REST Framework 3.5, OpenAPI has emerged as the widely adopted standard for modeling Web APIs.

This release deprecates the old CoreAPI based schema generation, and introduces improved OpenAPI schema generation in its place.
This release begins the deprecation process for the CoreAPI based schema generation, and introduces OpenAPI schema generation in its place.

----
---

## Continuing to use CoreAPI

If you're currently using the CoreAPI schemas, you'll need to make sure to
update your REST framework settings to include `DEFAULT_SCHEMA_CLASS` explicitly.

**settings.py**:

```python
REST_FRAMEWORK = {
...
'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.coreapi.AutoSchema'
}
```

You'll still be able to keep using CoreAPI schemas, API docs, and client for the
foreseeable future. We'll aim to ensure that the CoreAPI schema generator remains
available as a third party package, even once it has eventually been removed
from REST framework, scheduled for version 3.12.

We have removed the old documentation for the CoreAPI based schema generation.
You may view the [Legacy CoreAPI documentation here][legacy-core-api-docs].

---

**Switching mode between `CoreAPI` and `OpenAPI`**

Expand Down Expand Up @@ -40,9 +67,13 @@ REST_FRAMEWORK = {

----

### Quickstart
## Quickstart

You can generate a static OpenAPI schema, using the `generateschema` management
command.

To get going with `OpenAPI` schemas, use the `get_schema_view()` shortcut.
Alternately, to have the project serve an API schema, use the `get_schema_view()`
shortcut.

In your `urls.py`:

Expand All @@ -62,43 +93,41 @@ urlpatterns = [
]
```

See the Schemas documentation for more details.
### Customization

### Feature Roadmap
For customizations that you want to apply across the the entire API, you can subclass `rest_framework.schemas.openapi.SchemaGenerator` and provide it as an argument
to the `generateschema` command or `get_schema_view()` helper function.

For v3.7 (with `CoreAPI`) we tried to anticipate customizations that people
were likely to need. (Introducing `manual_fields` and `ManaualSchema`, for
example.) These were under-utilised. They weren't the right abstractions.
For specific per-view customizations, you can subclass `AutoSchema`,
making sure to set `schema = <YourCustomClass>` on the view.

So, for a fresh start with `OpenAPI`, customizing schema generation has two
simple rules:
For more details, see the [API Schema documentation](../api-guide/schemas.md).

* Subclass `SchemaGenerator` for schema-level cusomizations.
* Subclass `AutoSchema` for view-level customizations.
### API Documentation

We'll wait to see what subclasses people actually come up with, for the
customizations they actually need, before trying to bring that back into the
core framework.
There are some great third party options for documenting your API, based on the
OpenAPI schema.

There are two kinds of changes that easily predictable:
See the [Documenting you API](../topics/documenting-your-api.md) section for more details.

* General improvements which fill in gaps in the automatic schema generation.
* More use-case specific adjustments, which adjust the API of `SchemaGenerator`
or `AutoSchema`

We'll aim to bring the first type of change quickly in point releases. For the
second kind we'd like to adopt a slower approach, to make sure we keep the API
simple, and as widely applicable as possible, before we bring in API changes.
---

We trust that approach makes sense.
## Feature Roadmap

### Deprecating CoreAPI Schema Generation.
Given that our OpenAPI schema generation is a new feature, it's likely that there
will still be some iterative improvements for us to make. There will be two
main cases here:

The in-built docs that were introduced in Django REST Framework v3.5 were built on CoreAPI. These are now deprecated. You may continue to use them but they will be **removed in Django REST Framework v 3.12**.
* Expanding the supported range of OpenAPI schemas that are generated by default.
* Improving the ability for developers to customize the output.

You should migrate to using the new OpenAPI based schema generation as soon as you can.
We'll aim to bring the first type of change quickly in point releases. For the
second kind we'd like to adopt a slower approach, to make sure we keep the API
simple, and as widely applicable as possible, before we bring in API changes.

We have removed the old documentation for the CoreAPI based schema generation.
You may view the [Legacy CoreAPI documentation here][legacy-core-api-docs].
It's also possible that we'll end up implementing API documentation and API client
tooling that are driven by the OpenAPI schema. The `apistar` project has a
significant amount of work towards this. However, if we do so, we'll plan
on keeping any tooling outside of the core framework.

[legacy-core-api-docs]:https://github.com/encode/django-rest-framework/blob/master/docs/coreapi/index.md
15 changes: 12 additions & 3 deletions docs/community/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,21 @@ You can determine your currently installed version using `pip show`:

### 3.10.0

**Date**: [Unreleased][3.10.0-milestone]
**Date**: [15th July 2019][3.10.0-milestone]

* Switch to OpenAPI schema generation.
* Drop Python 2 support.
* Add `generateschema --generator_class` CLI option
* Updated PyYaml dependency for OpenAPI schema generation to `pyyaml>=5.1` [#6680][gh6680]
* Resolve DeprecationWarning with markdown. [#6317][gh6317]
* Add `generateschema --generator_class` CLI option

* Use `user.get_username` in templates, in preference to `user.username`.
* Fix for cursor pagination issue that could occur after object deletions.
* Fix for nullable fields with `source="*"`
* Always apply all throttle classes during throttling checks.
* Updates to jQuery and Markdown dependencies.
* Don't strict disallow redundant `SerializerMethodField` field name arguments.
* Don't render extra actions in browable API if not authenticated.
* Strip null characters from search parameters.

## 3.9.x series

Expand Down
2 changes: 1 addition & 1 deletion rest_framework/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""

__title__ = 'Django REST framework'
__version__ = '3.9.3'
__version__ = '3.10.0'
__author__ = 'Tom Christie'
__license__ = 'BSD 2-Clause'
__copyright__ = 'Copyright 2011-2019 Encode OSS Ltd'
Expand Down
Binary file modified rest_framework/locale/ach/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/ar/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/be/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/ca/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/ca_ES/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/cs/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/da/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/de/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/el/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/el_GR/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/en/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/en_AU/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/en_CA/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/en_US/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/es/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/et/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/fa/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/fa_IR/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/fi/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/fr/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/fr_CA/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/gl/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/gl_ES/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/he_IL/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/hu/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/id/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/it/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/ja/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/ko_KR/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/lv/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/mk/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/nb/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/nl/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/nn/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/no/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/pl/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/pt/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/pt_BR/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/pt_PT/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/ro/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/ru/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/sk/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/sl/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/sv/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/tr/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/tr_TR/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/uk/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/vi/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/zh_CN/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/zh_Hans/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/zh_Hant/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified rest_framework/locale/zh_TW/LC_MESSAGES/django.mo
Binary file not shown.