- Language: en
- Documentation version: 3.12
- Generic views
- Serializer fields
- Serializer relations
- Content negotiation
- Format suffixes
- Returning URLs
- Status codes
- Tutorials and Resources
- Third Party Packages
- Contributing to REST framework
- Project management
- Release Notes
- 3.12 Announcement
- 3.11 Announcement
- 3.10 Announcement
- 3.9 Announcement
- 3.8 Announcement
- 3.7 Announcement
- 3.6 Announcement
- 3.5 Announcement
- 3.4 Announcement
- 3.3 Announcement
- 3.2 Announcement
- 3.1 Announcement
- 3.0 Announcement
- Kickstarter Announcement
- Mozilla Grant
Django REST framework 3.8¶
The 3.8 release is a maintenance focused release resolving a large number of previously outstanding issues and laying the foundations for future changes.
We’d like to say thanks in particular our premium backers, :doc:`Rover <https://www.rover.com/careers/>`, :doc:`Sentry <https://sentry.io/welcome/>`, `Stream <https://getstream.io/?utm_source=drf&utm_medium=banner&utm_campaign=drf>`_, :doc:`Machinalis <https://machinalis.com/>`, and :doc:`Rollbar <https://rollbar.com>`.
Altered the behaviour of
default on Field.¶
read_only fields will now always be excluded from writable fields.
read_only fields when combined with a
default value would use the
default for create and update
operations. This was counter-intuitive in some circumstances and led to difficulties supporting dotted
attributes on nullable relations.
In order to maintain the old behaviour you may need to pass the value of
read_only fields when calling
def perform_create(self, serializer): serializer.save(owner=self.request.user)
Alternatively you may override
update() on the serializer as appropriate.
action decorator replaces
detail_route have been merge into a single
action decorator. This improves viewset action introspection, and will allow extra actions to be displayed in the Browsable API in future versions.
detail_route are now pending deprecation. They will be deprecated in 3.9 and removed entirely
action decorator takes a boolean
APIView.exclude_from_schema and the
exclude_from_schema argument to the
@api_view decorator are now deprecated. They will be removed entirely in 3.9.
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
Minor fixes and improvements¶
There are a large number of minor fixes and improvements in this release. See the release notes page for a complete listing.
We’re currently working towards moving to using OpenAPI as our default schema output. We’ll also be revisiting our API documentation generation and client libraries.
We’re doing some consolidation in order to make this happen. It’s planned that 3.9 will drop the
coreschema libraries, and instead use
apistar for the API documentation generation, schema generation, and API client libraries.