Skip to content

Version 3.13 #8285

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 4 commits into from
Dec 13, 2021
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
55 changes: 55 additions & 0 deletions docs/community/3.13-announcement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<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.13

## Django 4.0 support

The latest release now fully supports Django 4.0.

Our requirements are now:

* Python 3.6+
* Django 4.0, 3.2, 3.1, 2.2 (LTS)

## Fields arguments are now keyword-only

When instantiating fields on serializers, you should always use keyword arguments,
such as `serializers.CharField(max_length=200)`. This has always been the case,
and all the examples that we have in the documentation use keyword arguments,
rather than positional arguments.

From REST framework 3.13 onwards, this is now *explicitly enforced*.

The most feasible cases where users might be accidentally omitting the keyword arguments
are likely in the composite fields, `ListField` and `DictField`. For instance...

```python
aliases = serializers.ListField(serializers.CharField())
```

They must now use the more explicit keyword argument style...

```python
aliases = serializers.ListField(child=serializers.CharField())
```

This change has been made because using positional arguments here *does not* result in the expected behaviour.

See Pull Request [#7632](https://github.com/encode/django-rest-framework/pull/7632) for more details.
16 changes: 16 additions & 0 deletions docs/community/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ You can determine your currently installed version using `pip show`:

---

## 3.13.x series

### 3.13.0

Date: 13th December 2021

* Django 4.0 compatability. [#8178]
* Add `max_length` and `min_length` options to `ListSerializer`. [#8165]
* Add `get_request_serializer` and `get_response_serializer` hooks to `AutoSchema`. [#7424]
* Fix OpenAPI representation of null-able read only fields. [#8116]
* Respect `UNICODE_JSON` setting in API schema outputs. [#7991]
* Fix for `RemoteUserAuthentication`. [#7158]
* Make Field constructors keyword-only. [#7632]

---

## 3.12.x series

### 3.12.4
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ nav:
- 'Contributing to REST framework': 'community/contributing.md'
- 'Project management': 'community/project-management.md'
- 'Release Notes': 'community/release-notes.md'
- '3.13 Announcement': 'community/3.13-announcement.md'
- '3.12 Announcement': 'community/3.12-announcement.md'
- '3.11 Announcement': 'community/3.11-announcement.md'
- '3.10 Announcement': 'community/3.10-announcement.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 @@ -10,7 +10,7 @@
import django

__title__ = 'Django REST framework'
__version__ = '3.12.4'
__version__ = '3.13.0'
__author__ = 'Tom Christie'
__license__ = 'BSD 3-Clause'
__copyright__ = 'Copyright 2011-2019 Encode OSS Ltd'
Expand Down