Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
be5e4b4
Set version number for 3.7.0 release
carltongibson Sep 20, 2017
cecaa27
Rename release notes section
carltongibson Sep 20, 2017
8d7650c
Add release note for #5273
carltongibson Sep 20, 2017
cb09566
Add release note for #5440
carltongibson Sep 22, 2017
ec83df3
Add release note for #5265
carltongibson Sep 25, 2017
dbc0ce0
Add release note for #5250
carltongibson Sep 25, 2017
4aa711c
Add release notes for #5170
carltongibson Sep 25, 2017
73da8e9
Add release notes for #5443
carltongibson Sep 26, 2017
ebdb66d
Add release notes for #5448
carltongibson Sep 26, 2017
d1c740c
Add release notes for #5452
carltongibson Sep 26, 2017
fd027b2
Add release not for #5342
carltongibson Sep 26, 2017
94f074e
Add release notes for 5454
carltongibson Sep 27, 2017
7d6d7b6
Add release notes for #5058 & #5457
carltongibson Sep 27, 2017
d76cca3
Release notes for merged 3.6.5 milestone tickets
carltongibson Sep 28, 2017
18a2e64
Add release notes for #5469
carltongibson Oct 2, 2017
2ea1625
Add release notes from AM 2ndOct
carltongibson Oct 2, 2017
dde59ea
Add final changes to the release notes.
carltongibson Oct 5, 2017
6601f5e
Add date and milestone link
carltongibson Oct 5, 2017
d20d701
Update translations from transifex
carltongibson Oct 5, 2017
0cbc14a
Begin releae anouncement
carltongibson Oct 5, 2017
1dadb1c
Add release note for #5482
carltongibson Oct 5, 2017
de4ec58
Merge branch 'master' into version-3.7
lovelydinosaur Oct 6, 2017
51ceabb
3.7 release announcement & related docs.
lovelydinosaur Oct 6, 2017
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
Prev Previous commit
3.7 release announcement & related docs.
  • Loading branch information
lovelydinosaur committed Oct 6, 2017
commit 51ceabbea1cc8306b85610f8beda21a0089848e4
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ There is a live example API for testing purposes, [available here][sandbox].
# Requirements

* Python (2.7, 3.4, 3.5, 3.6)
* Django (1.10, 1.11)
* Django (1.10, 1.11, 2.0 alpha)

# Installation

Expand Down
5 changes: 3 additions & 2 deletions docs/api-guide/schemas.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ Basic usage is just to provide the title for your schema and call
generator = schemas.SchemaGenerator(title='Flight Search API')
schema = generator.get_schema()

### Per-View Schema Customisation
## Per-View Schema Customisation

By default, view introspection is performed by an `AutoSchema` instance
accessible via the `schema` attribute on `APIView`. This provides the
Expand Down Expand Up @@ -191,7 +191,7 @@ To customise the `Link` generation you may:

class CustomSchema(AutoSchema):
def get_link(...):
# Implemet custom introspection here (or in other sub-methods)
# Implement custom introspection here (or in other sub-methods)

class CustomView(APIView):
...
Expand Down Expand Up @@ -784,3 +784,4 @@ in [OpenAPI][open-api] format.
[api-blueprint]: https://apiblueprint.org/
[static-files]: https://docs.djangoproject.com/en/stable/howto/static-files/
[named-arguments]: https://docs.djangoproject.com/en/stable/topics/http/urls/#named-groups

Binary file added docs/img/bayer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ continued development by **[signing up for a paid plan][funding]**.
REST framework requires the following:

* Python (2.7, 3.2, 3.3, 3.4, 3.5, 3.6)
* Django (1.8, 1.9, 1.10, 1.11)
* Django (1.10, 1.11, 2.0 alpha)

The following packages are optional:

Expand Down Expand Up @@ -247,6 +247,7 @@ General guides to using REST framework.
* [3.4 Announcement][3.4-announcement]
* [3.5 Announcement][3.5-announcement]
* [3.6 Announcement][3.6-announcement]
* [3.7 Announcement][3.7-announcement]
* [Kickstarter Announcement][kickstarter-announcement]
* [Mozilla Grant][mozilla-grant]
* [Funding][funding]
Expand Down Expand Up @@ -377,6 +378,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[3.4-announcement]: topics/3.4-announcement.md
[3.5-announcement]: topics/3.5-announcement.md
[3.6-announcement]: topics/3.6-announcement.md
[3.7-announcement]: topics/3.7-announcement.md
[kickstarter-announcement]: topics/kickstarter-announcement.md
[mozilla-grant]: topics/mozilla-grant.md
[funding]: topics/funding.md
Expand Down
128 changes: 115 additions & 13 deletions docs/topics/3.7-announcement.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,131 @@

<style>
.promo li a {
float: left;
width: 130px;
height: 20px;
text-align: center;
margin: 10px 30px;
padding: 150px 0 0 0;
background-position: 0 50%;
background-size: 130px auto;
background-repeat: no-repeat;
font-size: 120%;
color: black;
}
.promo li {
list-style: none;
}
</style>

# Django REST framework 3.7

The 3.7 release focuses on improvements to schema generation and interactive API
documentation.
The 3.7 release focuses on improvements to schema generation and the interactive API documentation.

## Per-view customisation of schema generation.
This release has been made possible by [Bayer](https://www.bayer.com/) who have sponsored the release.

`APIView` now exposes a `schema` attribute. By default this is an instance of
`rest_framwork.schemas.AutoSchema`. You can subclass this to customise schema
generation on a per-view basis, whilst maintaining the default schema generation
elsewhere.
<a href="https://www.bayer.com/"><img src="/img/bayer.png"/></a>

See [Schema Docs][schema-docs] for full details.
---

[schema-docs]: ../api-guide/schemas.md
## Funding

If you use REST framework commercially and would like to see this work continue, we strongly encourage you to invest in its continued development by
**[signing up for a paid&nbsp;plan][funding]**.

<ul class="premium-promo promo">
<li><a href="http://jobs.rover.com/" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/rover_130x130.png)">Rover.com</a></li>
<li><a href="https://getsentry.com/welcome/" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/sentry130.png)">Sentry</a></li>
<li><a href="https://getstream.io/try-the-api/?utm_source=drf&utm_medium=banner&utm_campaign=drf" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/stream-130.png)">Stream</a></li>
<li><a href="https://hello.machinalis.co.uk/" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/Machinalis130.png)">Machinalis</a></li>
<li><a href="https://rollbar.com" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/rollbar.png)">Rollbar</a></li>
</ul>
<div style="clear: both; padding-bottom: 20px;"></div>

*As well as our release sponsor, we'd like to say thanks in particular our premium backers, [Rover](http://jobs.rover.com/), [Sentry](https://getsentry.com/welcome/), [Stream](https://getstream.io/?utm_source=drf&utm_medium=banner&utm_campaign=drf), [Machinalis](https://hello.machinalis.co.uk/), and [Rollbar](https://rollbar.com).*

---

## Customizing API docs & schema generation.

The schema generation introduced in 3.5 and the related API docs generation in 3.6 are both hugely powerful features, however they've been somewhat limited in cases where the view introspection isn't able to correctly identify the schema for a particular view.

In order to try to address this we're now adding the ability for per-view customization of the API schema. The interface that we're adding for this allows either basic manual overrides over which fields should be included on a view, or for more complex programmatic overriding of the schema generation. We believe this release comprehensively addresses some of the existing shortcomings of the schema features.

Let's take a quick look at using the new functionality...

The `APIView` class has a `schema` attribute, that is used to control how the Schema for that particular view is generated. The default behaviour is to use the `AutoSchema` class.

from rest_framework.views import APIView
from rest_framework.schemas import AutoSchema

class CustomView(APIView):
schema = AutoSchema() # Included for demonstration only. This is the default behavior.

We can remove a view from the API schema and docs, like so:

class CustomView(APIView):
schema = None

If we want to mostly use the default behavior, but additionally include some additional fields on a particular view, we can now do so easily...

class CustomView(APIView):
schema = AutoSchema(manual_fields=[
coreapi.Field('search', location='query')
])

To ignore the automatic generation for a particular view, and instead specify the schema explicitly, we use the `ManualSchema` class instead...

class CustomView(APIView):
schema = ManualSchema(fields=[...])

For more advanced behaviors you can subclass `AutoSchema` to provide for customized schema generation, and apply that to particular views.

class CustomView(APIView):
schema = CustomizedSchemaGeneration()

For full details on the new functionality, please see the [Schema Documentation][schema-docs].

---

## Django 2.0 support

REST framework 3.7 supports Django versions 1.10, 1.11, and 2.0 alpha.

---

## Minor fixes and improvements

There are a large number of minor fixes and improvements in this release. See the [release notes](release-notes.md) page for a complete listing.

The number of [open tickets against the project](https://github.com/encode/django-rest-framework/issues) currently at its lowest number in quite some time, and we're continuing to focus on reducing these to a manageable amount.

---

## Deprecations

### `exclude_from_schema`

Both `APIView.exclude_from_schema` and the `exclude_from_schema` argument to the
`@api_view` decorator and now `PendingDeprecation`.
Both `APIView.exclude_from_schema` and the `exclude_from_schema` argument to the `@api_view` decorator and now `PendingDeprecation`. They will be moved to deprecated in the 3.8 release, and removed entirely in 3.9.

For `APIView` you should instead set a `schema = None` attribute on the view class.

For function based views the `@schema` decorator can be used to exclude the view from the schema, by using `@schema(None)`.

### `DjangoFilterBackend`

For `APIView` set `schema = None`. For function based views use the `@schema`
decorator passing `None`.
The `DjangoFilterBackend` was moved to pending deprecation in 3.5, and deprecated in 3.6. It has now been removed from the core framework.

The functionality remains fully available, but is instead provided in the `django-filter` package.

---

## What's next

We're still planning to work on improving real-time support for REST framework by providing documentation on integrating with Django channels, as well adding support for more easily adding WebSocket support to existing HTTP endpoints.

This will likely be timed so that any REST framework development here ties in with similar work on [API Star][api-star].

[funding]: funding.md
[schema-docs]: ../api-guide/schemas.md
[api-star]: https://github.com/encode/apistar
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ pages:
- '3.4 Announcement': 'topics/3.4-announcement.md'
- '3.5 Announcement': 'topics/3.5-announcement.md'
- '3.6 Announcement': 'topics/3.6-announcement.md'
- '3.7 Announcement': 'topics/3.7-announcement.md'
- 'Kickstarter Announcement': 'topics/kickstarter-announcement.md'
- 'Mozilla Grant': 'topics/mozilla-grant.md'
- 'Funding': 'topics/funding.md'
Expand Down