| 1 |
<style> |
| 2 |
.promo li a { |
| 3 |
float: left; |
| 4 |
width: 130px; |
| 5 |
height: 20px; |
| 6 |
text-align: center; |
| 7 |
margin: 10px 30px; |
| 8 |
padding: 150px 0 0 0; |
| 9 |
background-position: 0 50%; |
| 10 |
background-size: 130px auto; |
| 11 |
background-repeat: no-repeat; |
| 12 |
font-size: 120%; |
| 13 |
color: black; |
| 14 |
} |
| 15 |
.promo li { |
| 16 |
list-style: none; |
| 17 |
} |
| 18 |
</style> |
| 19 |
|
| 20 |
# Django REST framework 3.13 |
| 21 |
|
| 22 |
## Django 4.0 support |
| 23 |
|
| 24 |
The latest release now fully supports Django 4.0. |
| 25 |
|
| 26 |
Our requirements are now: |
| 27 |
|
| 28 |
* Python 3.6+ |
| 29 |
* Django 4.0, 3.2, 3.1, 2.2 (LTS) |
| 30 |
|
| 31 |
## Fields arguments are now keyword-only |
| 32 |
|
| 33 |
When instantiating fields on serializers, you should always use keyword arguments, |
| 34 |
such as `serializers.CharField(max_length=200)`. This has always been the case, |
| 35 |
and all the examples that we have in the documentation use keyword arguments, |
| 36 |
rather than positional arguments. |
| 37 |
|
| 38 |
From REST framework 3.13 onwards, this is now *explicitly enforced*. |
| 39 |
|
| 40 |
The most feasible cases where users might be accidentally omitting the keyword arguments |
| 41 |
are likely in the composite fields, `ListField` and `DictField`. For instance... |
| 42 |
|
| 43 |
```python |
| 44 |
aliases = serializers.ListField(serializers.CharField()) |
| 45 |
``` |
| 46 |
|
| 47 |
They must now use the more explicit keyword argument style... |
| 48 |
|
| 49 |
```python |
| 50 |
aliases = serializers.ListField(child=serializers.CharField()) |
| 51 |
``` |
| 52 |
|
| 53 |
This change has been made because using positional arguments here *does not* result in the expected behavior. |
| 54 |
|
| 55 |
See Pull Request [#7632](https://github.com/encode/django-rest-framework/pull/7632) for more details. |