You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 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.
*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).*
46
+
47
+
---
48
+
49
+
## Customizing API docs & schema generation.
50
+
51
+
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.
52
+
53
+
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.
54
+
55
+
Let's take a quick look at using the new functionality...
56
+
57
+
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.
58
+
59
+
from rest_framework.views import APIView
60
+
from rest_framework.schemas import AutoSchema
61
+
62
+
class CustomView(APIView):
63
+
schema = AutoSchema() # Included for demonstration only. This is the default behavior.
64
+
65
+
We can remove a view from the API schema and docs, like so:
66
+
67
+
class CustomView(APIView):
68
+
schema = None
69
+
70
+
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...
71
+
72
+
class CustomView(APIView):
73
+
schema = AutoSchema(manual_fields=[
74
+
coreapi.Field('search', location='query')
75
+
])
76
+
77
+
To ignore the automatic generation for a particular view, and instead specify the schema explicitly, we use the `ManualSchema` class instead...
78
+
79
+
class CustomView(APIView):
80
+
schema = ManualSchema(fields=[...])
81
+
82
+
For more advanced behaviors you can subclass `AutoSchema` to provide for customized schema generation, and apply that to particular views.
83
+
84
+
class CustomView(APIView):
85
+
schema = CustomizedSchemaGeneration()
86
+
87
+
For full details on the new functionality, please see the [Schema Documentation][schema-docs].
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.
100
+
101
+
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.
102
+
103
+
---
104
+
105
+
## Deprecations
106
+
107
+
### `exclude_from_schema`
108
+
109
+
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.
110
+
111
+
For `APIView` you should instead set a `schema = None` attribute on the view class.
112
+
113
+
For function based views the `@schema` decorator can be used to exclude the view from the schema, by using `@schema(None)`.
114
+
115
+
### `DjangoFilterBackend`
116
+
117
+
The `DjangoFilterBackend` was moved to pending deprecation in 3.5, and deprecated in 3.6. It has now been removed from the core framework.
118
+
119
+
The functionality remains fully available, but is instead provided in the `django-filter` package.
120
+
121
+
---
122
+
123
+
## What's next
124
+
125
+
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.
126
+
127
+
This will likely be timed so that any REST framework development here ties in with similar work on [API Star][api-star].
Copy file name to clipboardExpand all lines: docs/topics/release-notes.md
+97-4
Original file line number
Diff line number
Diff line change
@@ -38,18 +38,69 @@ You can determine your currently installed version using `pip freeze`:
38
38
39
39
---
40
40
41
-
## 3.6.x series
41
+
## 3.7.x series
42
+
43
+
### 3.7.0
42
44
43
-
### 3.6.5
45
+
**Date**: [6th October 2017][3.7.0-milestone]
44
46
45
47
* 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]
46
48
* Deprecated `exclude_from_schema` on `APIView` and `api_view` decorator. Set `schema = None` or `@schema(None)` as appropriate. [#5422][gh5422]
47
-
* Timezone-aware `DateTimeField`s now respect active or default `timezone` during serialization, instead of always using UTC.
49
+
* Timezone-aware `DateTimeField`s now respect active or default `timezone` during serialization, instead of always using UTC.[#5435][gh5435]
48
50
49
51
Resolves inconsistency whereby instances were serialised with supplied datetime for `create` but UTC for `retrieve`. [#3732][gh3732]
50
52
51
53
**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.
52
54
55
+
* Removed DjangoFilterBackend inline with deprecation policy. Use `django_filters.rest_framework.FilterSet` and/or `django_filters.rest_framework.DjangoFilterBackend` instead. [#5273][gh5273]
56
+
* Don't strip microseconds from `time` when encoding. Makes consistent with `datetime`.
57
+
**BC Change**: Previously only milliseconds were encoded. [#5440][gh5440]
58
+
* Added `STRICT_JSON` setting (default `True`) to raise exception for the extended float values (`nan`, `inf`, `-inf`) accepted by Python's `json` module.
59
+
**BC Change**: Previously these values would converted to corresponding strings. Set `STRICT_JSON` to `False` to restore the previous behaviour. [#5265][gh5265]
60
+
* Add support for `page_size` parameter in CursorPaginator class [#5250][gh5250]
61
+
* Make `DEFAULT_PAGINATION_CLASS``None` by default.
62
+
**BC Change**: If your were **just** setting `PAGE_SIZE` to enable pagination you will need to add `DEFAULT_PAGINATION_CLASS`.
63
+
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]
64
+
* Catch `APIException` from `get_serializer_fields` in schema generation. [#5443][gh5443]
65
+
* Allow custom authentication and permission classes when using `include_docs_urls`[#5448][gh5448]
66
+
* Defer translated string evaluation on validators. [#5452][gh5452]
67
+
* Added default value for 'detail' param into 'ValidationError' exception [#5342][gh5342]
68
+
* Adjust schema get_filter_fields rules to match framework [#5454][gh5454]
69
+
* Updated test matrix to add Django 2.0 and drop Django 1.8 & 1.9
70
+
**BC Change**: This removes Django 1.8 and Django 1.9 from Django REST Framework supported versions. [#5457][gh5457]
71
+
* Fixed a deprecation warning in serializers.ModelField [#5058][gh5058]
72
+
* Added a more explicit error message when `get_queryset` returned `None`[#5348][gh5348]
73
+
* Fix docs for Response `data` description [#5361][gh5361]
74
+
* Fix __pychache__/.pyc excludes when packaging [#5373][gh5373]
75
+
* Fix default value handling for dotted sources [#5375][gh5375]
76
+
* Ensure content_type is set when passing empty body to RequestFactory [#5351][gh5351]
77
+
* Fix ErrorDetail Documentation [#5380][gh5380]
78
+
* Allow optional content in the generic content form [#5372][gh5372]
79
+
* Updated supported values for the NullBooleanField [#5387][gh5387]
80
+
* Fix ModelSerializer custom named fields with source on model [#5388][gh5388]
81
+
* Fixed the MultipleFieldLookupMixin documentation example to properly check for object level permission [#5398][gh5398]
82
+
* Update get_object() example in permissions.md [#5401][gh5401]
83
+
* Fix authtoken managment command [#5415][gh5415]
84
+
* Fix schema generation markdown [#5421][gh5421]
85
+
* Allow `ChoiceField.choices` to be set dynamically [#5426][gh5426]
86
+
* Add the project layout to the quickstart [#5434][gh5434]
87
+
* Reuse 'apply_markdown' function in 'render_markdown' templatetag [#5469][gh5469]
88
+
* Added links to `drf-openapi` package in docs [#5470][gh5470]
89
+
* Added docstrings code highlighting with pygments [#5462][gh5462]
90
+
* Fixed documentation rendering for views named `data`[#5472][gh5472]
0 commit comments