Skip to content

Commit

Permalink
Version 3.7: Announcement etc (#5437)
Browse files Browse the repository at this point in the history
* Set version number for 3.7.0 release

* Rename release notes section

Moved issue links to top for easier access.
(Can move back later)

* Add release note for #5273

* Add release note for #5440

* Add release note for #5265

Strict JSON handling

* Add release note for #5250

* Add release notes for #5170

* Add release notes for #5443

* Add release notes for #5448

* Add release notes for #5452

* Add release not for #5342

* Add release notes for 5454

* Add release notes for #5058 & #5457

Remove Django 1.8 & 1.9 from README and setup.py

* Release notes for merged 3.6.5 milestone tickets

Tickets migrated to 3.7.0 milestone.

* Add release notes for #5469

* Add release notes from AM 2ndOct

* Add final changes to the release notes.

* Add date and milestone link

Move issue links back to bottom.

* Update translations from transifex

* Begin releae anouncement

* Add release note for #5482

* 3.7 release announcement & related docs.
  • Loading branch information
Carlton Gibson authored Oct 6, 2017
1 parent b2ca2c1 commit eb3d078
Show file tree
Hide file tree
Showing 13 changed files with 257 additions and 31 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ There is a live example API for testing purposes, [available here][sandbox].

# Requirements

* Python (2.7, 3.2, 3.3, 3.4, 3.5, 3.6)
* Django (1.8, 1.9, 1.10, 1.11)
* Python (2.7, 3.4, 3.5, 3.6)
* 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
131 changes: 131 additions & 0 deletions docs/topics/3.7-announcement.md
Original file line number Diff line number Diff line change
@@ -0,0 +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 the interactive API documentation.

This release has been made possible by [Bayer](https://www.bayer.com/) who have sponsored the release.

<a href="https://www.bayer.com/"><img src="/img/bayer.png"/></a>

---

## 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`. 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`

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
101 changes: 97 additions & 4 deletions docs/topics/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,69 @@ You can determine your currently installed version using `pip freeze`:

---

## 3.6.x series
## 3.7.x series

### 3.7.0

### 3.6.5
**Date**: [6th October 2017][3.7.0-milestone]

* Fix `DjangoModelPermissions` to ensure user authentication before calling the view's `get_queryset()` method. As a side effect, this changes the order of the HTTP method permissions and authentication checks, and 405 responses will only be returned when authenticated. If you want to replicate the old behavior, see the PR for details. [#5376][gh5376]
* Deprecated `exclude_from_schema` on `APIView` and `api_view` decorator. Set `schema = None` or `@schema(None)` as appropriate. [#5422][gh5422]
* Timezone-aware `DateTimeField`s now respect active or default `timezone` during serialization, instead of always using UTC.
* Timezone-aware `DateTimeField`s now respect active or default `timezone` during serialization, instead of always using UTC. [#5435][gh5435]

Resolves inconsistency whereby instances were serialised with supplied datetime for `create` but UTC for `retrieve`. [#3732][gh3732]

**Possible backwards compatibility break** if you were relying on datetime strings being UTC. Have client interpret datetimes or [set default or active timezone (docs)][djangodocs-set-timezone] to UTC if needed.

* Removed DjangoFilterBackend inline with deprecation policy. Use `django_filters.rest_framework.FilterSet` and/or `django_filters.rest_framework.DjangoFilterBackend` instead. [#5273][gh5273]
* Don't strip microseconds from `time` when encoding. Makes consistent with `datetime`.
**BC Change**: Previously only milliseconds were encoded. [#5440][gh5440]
* Added `STRICT_JSON` setting (default `True`) to raise exception for the extended float values (`nan`, `inf`, `-inf`) accepted by Python's `json` module.
**BC Change**: Previously these values would converted to corresponding strings. Set `STRICT_JSON` to `False` to restore the previous behaviour. [#5265][gh5265]
* Add support for `page_size` parameter in CursorPaginator class [#5250][gh5250]
* Make `DEFAULT_PAGINATION_CLASS` `None` by default.
**BC Change**: If your were **just** setting `PAGE_SIZE` to enable pagination you will need to add `DEFAULT_PAGINATION_CLASS`.
The previous default was `rest_framework.pagination.PageNumberPagination`. There is a system check warning to catch this case. You may silence that if you are setting pagination class on a per-view basis. [#5170][gh5170]
* Catch `APIException` from `get_serializer_fields` in schema generation. [#5443][gh5443]
* Allow custom authentication and permission classes when using `include_docs_urls` [#5448][gh5448]
* Defer translated string evaluation on validators. [#5452][gh5452]
* Added default value for 'detail' param into 'ValidationError' exception [#5342][gh5342]
* Adjust schema get_filter_fields rules to match framework [#5454][gh5454]
* Updated test matrix to add Django 2.0 and drop Django 1.8 & 1.9
**BC Change**: This removes Django 1.8 and Django 1.9 from Django REST Framework supported versions. [#5457][gh5457]
* Fixed a deprecation warning in serializers.ModelField [#5058][gh5058]
* Added a more explicit error message when `get_queryset` returned `None` [#5348][gh5348]
* Fix docs for Response `data` description [#5361][gh5361]
* Fix __pychache__/.pyc excludes when packaging [#5373][gh5373]
* Fix default value handling for dotted sources [#5375][gh5375]
* Ensure content_type is set when passing empty body to RequestFactory [#5351][gh5351]
* Fix ErrorDetail Documentation [#5380][gh5380]
* Allow optional content in the generic content form [#5372][gh5372]
* Updated supported values for the NullBooleanField [#5387][gh5387]
* Fix ModelSerializer custom named fields with source on model [#5388][gh5388]
* Fixed the MultipleFieldLookupMixin documentation example to properly check for object level permission [#5398][gh5398]
* Update get_object() example in permissions.md [#5401][gh5401]
* Fix authtoken managment command [#5415][gh5415]
* Fix schema generation markdown [#5421][gh5421]
* Allow `ChoiceField.choices` to be set dynamically [#5426][gh5426]
* Add the project layout to the quickstart [#5434][gh5434]
* Reuse 'apply_markdown' function in 'render_markdown' templatetag [#5469][gh5469]
* Added links to `drf-openapi` package in docs [#5470][gh5470]
* Added docstrings code highlighting with pygments [#5462][gh5462]
* Fixed documentation rendering for views named `data` [#5472][gh5472]
* Docs: Clarified 'to_internal_value()' validation behavior [#5466][gh5466]
* Fix missing six.text_type() call on APIException.__str__ [#5476][gh5476]
* Document documentation.py [#5478][gh5478]
* Fix naming collisions in Schema Generation [#5464][gh5464]
* Call Django's authenticate function with the request object [#5295][gh5295]
* Update coreapi JS to 0.1.1 [#5479][gh5479]
* Have `is_list_view` recognise RetrieveModel… views [#5480][gh5480]
* Remove Django 1.8 & 1.9 compatibility code [#5481][gh5481]
* Remove deprecated schema code from DefaultRouter [#5482][gh5482]


## 3.6.x series

### 3.6.4

**Date**: [21st August 2017][3.6.4-milestone]
Expand Down Expand Up @@ -756,6 +807,7 @@ For older release notes, [please see the version 2.x documentation][old-release-
[3.6.2-milestone]: https://github.com/encode/django-rest-framework/issues?q=milestone%3A%223.6.2+Release%22
[3.6.3-milestone]: https://github.com/encode/django-rest-framework/issues?q=milestone%3A%223.6.3+Release%22
[3.6.4-milestone]: https://github.com/encode/django-rest-framework/issues?q=milestone%3A%223.6.4+Release%22
[3.7.0-milestone]: https://github.com/encode/django-rest-framework/issues?q=milestone%3A%223.7.0+Release%22

<!-- 3.0.1 -->
[gh2013]: https://github.com/encode/django-rest-framework/issues/2013
Expand Down Expand Up @@ -1427,9 +1479,50 @@ For older release notes, [please see the version 2.x documentation][old-release-
[gh5147]: https://github.com/encode/django-rest-framework/issues/5147
[gh5131]: https://github.com/encode/django-rest-framework/issues/5131

<!-- 3.6.5 -->
<!-- 3.7.0 -->
[gh5481]: https://github.com/encode/django-rest-framework/issues/5481
[gh5480]: https://github.com/encode/django-rest-framework/issues/5480
[gh5479]: https://github.com/encode/django-rest-framework/issues/5479
[gh5295]: https://github.com/encode/django-rest-framework/issues/5295
[gh5464]: https://github.com/encode/django-rest-framework/issues/5464
[gh5478]: https://github.com/encode/django-rest-framework/issues/5478
[gh5476]: https://github.com/encode/django-rest-framework/issues/5476
[gh5466]: https://github.com/encode/django-rest-framework/issues/5466
[gh5472]: https://github.com/encode/django-rest-framework/issues/5472
[gh5462]: https://github.com/encode/django-rest-framework/issues/5462
[gh5470]: https://github.com/encode/django-rest-framework/issues/5470
[gh5469]: https://github.com/encode/django-rest-framework/issues/5469
[gh5435]: https://github.com/encode/django-rest-framework/issues/5435
[gh5434]: https://github.com/encode/django-rest-framework/issues/5434
[gh5426]: https://github.com/encode/django-rest-framework/issues/5426
[gh5421]: https://github.com/encode/django-rest-framework/issues/5421
[gh5415]: https://github.com/encode/django-rest-framework/issues/5415
[gh5401]: https://github.com/encode/django-rest-framework/issues/5401
[gh5398]: https://github.com/encode/django-rest-framework/issues/5398
[gh5388]: https://github.com/encode/django-rest-framework/issues/5388
[gh5387]: https://github.com/encode/django-rest-framework/issues/5387
[gh5372]: https://github.com/encode/django-rest-framework/issues/5372
[gh5380]: https://github.com/encode/django-rest-framework/issues/5380
[gh5351]: https://github.com/encode/django-rest-framework/issues/5351
[gh5375]: https://github.com/encode/django-rest-framework/issues/5375
[gh5373]: https://github.com/encode/django-rest-framework/issues/5373
[gh5361]: https://github.com/encode/django-rest-framework/issues/5361
[gh5348]: https://github.com/encode/django-rest-framework/issues/5348
[gh5058]: https://github.com/encode/django-rest-framework/issues/5058
[gh5457]: https://github.com/encode/django-rest-framework/issues/5457
[gh5376]: https://github.com/encode/django-rest-framework/issues/5376
[gh5422]: https://github.com/encode/django-rest-framework/issues/5422
[gh5408]: https://github.com/encode/django-rest-framework/issues/5408
[gh3732]: https://github.com/encode/django-rest-framework/issues/3732
[djangodocs-set-timezone]: https://docs.djangoproject.com/en/1.11/topics/i18n/timezones/#default-time-zone-and-current-time-zone
[gh5273]: https://github.com/encode/django-rest-framework/issues/5273
[gh5440]: https://github.com/encode/django-rest-framework/issues/5440
[gh5265]: https://github.com/encode/django-rest-framework/issues/5265
[gh5250]: https://github.com/encode/django-rest-framework/issues/5250
[gh5170]: https://github.com/encode/django-rest-framework/issues/5170
[gh5443]: https://github.com/encode/django-rest-framework/issues/5443
[gh5448]: https://github.com/encode/django-rest-framework/issues/5448
[gh5452]: https://github.com/encode/django-rest-framework/issues/5452
[gh5342]: https://github.com/encode/django-rest-framework/issues/5342
[gh5454]: https://github.com/encode/django-rest-framework/issues/5454
[gh5482]: https://github.com/encode/django-rest-framework/issues/5482
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
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.6.4'
__version__ = '3.7.0'
__author__ = 'Tom Christie'
__license__ = 'BSD 2-Clause'
__copyright__ = 'Copyright 2011-2017 Tom Christie'
Expand Down
Binary file modified rest_framework/locale/en/LC_MESSAGES/django.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion rest_framework/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: Django REST framework\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-12 16:13+0100\n"
"PO-Revision-Date: 2016-07-12 15:14+0000\n"
"PO-Revision-Date: 2017-09-21 21:11+0000\n"
"Last-Translator: Thomas Christie <[email protected]>\n"
"Language-Team: English (http://www.transifex.com/django-rest-framework-1/django-rest-framework/language/en/)\n"
"MIME-Version: 1.0\n"
Expand Down
Binary file modified rest_framework/locale/ko_KR/LC_MESSAGES/django.mo
Binary file not shown.
Loading

0 comments on commit eb3d078

Please sign in to comment.