Skip to content

Commit 851c1f8

Browse files
Merge branch 'encode:master' into khaledsukkar2-patch-1
2 parents f3d8917 + 64c3d9e commit 851c1f8

File tree

20 files changed

+787
-65
lines changed

20 files changed

+787
-65
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Discussions
4+
url: https://github.com/encode/django-rest-framework/discussions
5+
about: >
6+
The "Discussions" forum is where you want to start. 💖
7+
Please note that at this point in its lifespan, we consider Django REST framework to be feature-complete.

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
At this point in its lifespan we consider Django REST framework to be essentially feature-complete. We may accept pull requests that track the continued development of Django versions, but would prefer not to accept new features or code formatting changes.
44

5+
Apart from minor documentation changes, the [GitHub discussions page](https://github.com/encode/django-rest-framework/discussions) should generally be your starting point. Please only open a pull request if you've been recommended to do so **after discussion**.
6+
57
The [Contributing guide in the documentation](https://www.django-rest-framework.org/community/contributing/) gives some more information on our process and code of conduct.

docs/api-guide/fields.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Set to false if this field is not required to be present during deserialization.
4242

4343
Setting this to `False` also allows the object attribute or dictionary key to be omitted from output when serializing the instance. If the key is not present it will simply not be included in the output representation.
4444

45-
Defaults to `True`. If you're using [Model Serializer](https://www.django-rest-framework.org/api-guide/serializers/#modelserializer) default value will be `False` if you have specified `blank=True` or `default` or `null=True` at your field in your `Model`.
45+
Defaults to `True`. If you're using [Model Serializer](https://www.django-rest-framework.org/api-guide/serializers/#modelserializer), the default value will be `False` when you have specified a `default`, or when the corresponding `Model` field has `blank=True` or `null=True` and is not part of a unique constraint at the same time. (Note that without a `default` value, [unique constraints will cause the field to be required](https://www.django-rest-framework.org/api-guide/validators/#optional-fields).)
4646

4747
### `default`
4848

docs/api-guide/permissions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ As with `DjangoModelPermissions` you can use custom model permissions by overrid
201201

202202
---
203203

204-
**Note**: If you need object level `view` permissions for `GET`, `HEAD` and `OPTIONS` requests and are using django-guardian for your object-level permissions backend, you'll want to consider using the `DjangoObjectPermissionsFilter` class provided by the [`djangorestframework-guardian2` package][django-rest-framework-guardian2]. It ensures that list endpoints only return results including objects for which the user has appropriate view permissions.
204+
**Note**: If you need object level `view` permissions for `GET`, `HEAD` and `OPTIONS` requests and are using django-guardian for your object-level permissions backend, you'll want to consider using the `DjangoObjectPermissionsFilter` class provided by the [`djangorestframework-guardian` package][django-rest-framework-guardian]. It ensures that list endpoints only return results including objects for which the user has appropriate view permissions.
205205

206206
---
207207

@@ -356,6 +356,6 @@ The [Django Rest Framework PSQ][drf-psq] package is an extension that gives supp
356356
[rest-framework-roles]: https://github.com/Pithikos/rest-framework-roles
357357
[djangorestframework-api-key]: https://florimondmanca.github.io/djangorestframework-api-key/
358358
[django-rest-framework-role-filters]: https://github.com/allisson/django-rest-framework-role-filters
359-
[django-rest-framework-guardian2]: https://github.com/johnthagen/django-rest-framework-guardian2
359+
[django-rest-framework-guardian]: https://github.com/rpkilby/django-rest-framework-guardian
360360
[drf-access-policy]: https://github.com/rsinger86/drf-access-policy
361361
[drf-psq]: https://github.com/drf-psq/drf-psq

docs/api-guide/throttling.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ You'll need to remember to also set your custom throttle class in the `'DEFAULT_
110110

111111
The built-in throttle implementations are open to [race conditions][race], so under high concurrency they may allow a few extra requests through.
112112

113-
If your project relies on guaranteeing the number of requests during concurrent requests, you will need to implement your own throttle class.
113+
If your project relies on guaranteeing the number of requests during concurrent requests, you will need to implement your own throttle class. See [issue #5181][gh5181] for more details.
114114

115115
---
116116

@@ -220,4 +220,5 @@ The following is an example of a rate throttle, that will randomly throttle 1 in
220220
[identifying-clients]: http://oxpedia.org/wiki/index.php?title=AppSuite:Grizzly#Multiple_Proxies_in_front_of_the_cluster
221221
[cache-setting]: https://docs.djangoproject.com/en/stable/ref/settings/#caches
222222
[cache-docs]: https://docs.djangoproject.com/en/stable/topics/cache/#setting-up-the-cache
223+
[gh5181]: https://github.com/encode/django-rest-framework/issues/5181
223224
[race]: https://en.wikipedia.org/wiki/Race_condition#Data_race

docs/api-guide/validators.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Most of the time you're dealing with validation in REST framework you'll simply
1313

1414
However, sometimes you'll want to place your validation logic into reusable components, so that it can easily be reused throughout your codebase. This can be achieved by using validator functions and validator classes.
1515

16-
## Validation in REST framework
16+
## Validation in REST framework
1717

1818
Validation in Django REST framework serializers is handled a little differently to how validation works in Django's `ModelForm` class.
1919

@@ -75,7 +75,7 @@ This validator should be applied to *serializer fields*, like so:
7575
validators=[UniqueValidator(queryset=BlogPost.objects.all())]
7676
)
7777

78-
## UniqueTogetherValidator
78+
## UniqueTogetherValidator
7979

8080
This validator can be used to enforce `unique_together` constraints on model instances.
8181
It has two required arguments, and a single optional `messages` argument:
@@ -92,7 +92,7 @@ The validator should be applied to *serializer classes*, like so:
9292
# ...
9393
class Meta:
9494
# ToDo items belong to a parent list, and have an ordering defined
95-
# by the 'position' field. No two items in a given list may share
95+
# by the 'position' field. No two items in a given list may share
9696
# the same position.
9797
validators = [
9898
UniqueTogetherValidator(
@@ -166,7 +166,7 @@ If you want the date field to be entirely hidden from the user, then use `Hidden
166166

167167
---
168168

169-
**Note:** `HiddenField()` does not appear in `partial=True` serializer (when making `PATCH` request).
169+
**Note:** `HiddenField()` does not appear in `partial=True` serializer (when making `PATCH` request).
170170

171171
---
172172

docs/community/contributing.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
>
55
> — [Tim Berners-Lee][cite]
66
7+
There are many ways you can contribute to Django REST framework. We'd like it to be a community-led project, so please get involved and help shape the future of the project.
8+
79
!!! note
810

911
At this point in its lifespan we consider Django REST framework to be feature-complete. We focus on pull requests that track the continued development of Django versions, and generally do not accept new features or code formatting changes.
@@ -28,9 +30,22 @@ The [Django code of conduct][code-of-conduct] gives a fuller set of guidelines f
2830

2931
# Issues
3032

33+
Our contribution process is that the [GitHub discussions page](https://github.com/encode/django-rest-framework/discussions) should generally be your starting point. Some tips on good potential issue reporting:
34+
3135
* Django REST framework is considered feature-complete. Please do not file requests to change behavior, unless it is required for security reasons or to maintain compatibility with upcoming Django or Python versions.
36+
* Search the GitHub project page for related items, and make sure you're running the latest version of REST framework before reporting an issue.
3237
* Feature requests will typically be closed with a recommendation that they be implemented outside the core REST framework library (e.g. as third-party libraries). This approach allows us to keep down the maintenance overhead of REST framework, so that the focus can be on continued stability and great documentation.
3338

39+
## Triaging issues
40+
41+
Getting involved in triaging incoming issues is a good way to start contributing. Every single ticket that comes into the ticket tracker needs to be reviewed in order to determine what the next steps should be. Anyone can help out with this, you just need to be willing to
42+
43+
* Read through the ticket - does it make sense, is it missing any context that would help explain it better?
44+
* Is the ticket reported in the correct place, would it be better suited as a discussion on the discussion group?
45+
* If the ticket is a bug report, can you reproduce it? Are you able to write a failing test case that demonstrates the issue and that can be submitted as a pull request?
46+
* If the ticket is a feature request, could the feature request instead be implemented as a third party package?
47+
* If a ticket hasn't had much activity and addresses something you need, then comment on the ticket and try to find out what's needed to get it moving again.
48+
3449
# Development
3550

3651
To start developing on Django REST framework, first create a Fork from the

docs/community/project-management.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Further notes for maintainers:
3434
* Code changes should come in the form of a pull request - do not push directly to master.
3535
* Maintainers should typically not merge their own pull requests.
3636
* Each issue/pull request should have exactly one label once triaged.
37+
* Search for un-triaged issues with [is:open no:label][un-triaged].
3738

3839
---
3940

@@ -156,6 +157,7 @@ The following issues still need to be addressed:
156157
* Document ownership and management of the security mailing list.
157158

158159
[bus-factor]: https://en.wikipedia.org/wiki/Bus_factor
160+
[un-triaged]: https://github.com/encode/django-rest-framework/issues?q=is%3Aopen+no%3Alabel
159161
[transifex-project]: https://www.transifex.com/projects/p/django-rest-framework/
160162
[transifex-client]: https://pypi.org/project/transifex-client/
161163
[translation-memory]: http://docs.transifex.com/guides/tm#let-tm-automatically-populate-translations

docs/community/release-notes.md

Lines changed: 69 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,83 @@ You can determine your currently installed version using `pip show`:
3838

3939
## 3.16.x series
4040

41+
### 3.16.1
42+
43+
**Date**: 6th August 2025
44+
45+
This release fixes a few bugs, clean-up some old code paths for unsupported Python versions and improve translations.
46+
47+
#### Minor changes
48+
49+
* Cleanup optional `backports.zoneinfo` dependency and conditions on unsupported Python 3.8 and lower in [#9681](https://github.com/encode/django-rest-framework/pull/9681). Python versions prior to 3.9 were already unsupported so this shouldn't be a breaking change.
50+
51+
#### Bug fixes
52+
53+
* Fix regression in `unique_together` validation with `SerializerMethodField` in [#9712](https://github.com/encode/django-rest-framework/pull/9712)
54+
* Fix `UniqueTogetherValidator` to handle fields with `source` attribute in [#9688](https://github.com/encode/django-rest-framework/pull/9688)
55+
* Drop HTML line breaks on long headers in browsable API in [#9438](https://github.com/encode/django-rest-framework/pull/9438)
56+
57+
#### Translations
58+
59+
* Add Kazakh locale support in [#9713](https://github.com/encode/django-rest-framework/pull/9713)
60+
* Update translations for Korean translations in [#9571](https://github.com/encode/django-rest-framework/pull/9571)
61+
* Update German translations in [#9676](https://github.com/encode/django-rest-framework/pull/9676)
62+
* Update Chinese translations in [#9675](https://github.com/encode/django-rest-framework/pull/9675)
63+
* Update Arabic translations-sal in [#9595](https://github.com/encode/django-rest-framework/pull/9595)
64+
* Update Persian translations in [#9576](https://github.com/encode/django-rest-framework/pull/9576)
65+
* Update Spanish translations in [#9701](https://github.com/encode/django-rest-framework/pull/9701)
66+
* Update Turkish Translations in [#9749](https://github.com/encode/django-rest-framework/pull/9749)
67+
* Fix some typos in Brazilian Portuguese translations in [#9673](https://github.com/encode/django-rest-framework/pull/9673)
68+
69+
#### Documentation
70+
71+
* Removed reference to GitHub Issues and Discussions in [#9660](https://github.com/encode/django-rest-framework/pull/9660)
72+
* Add `drf-restwind` and update outdated images in `browsable-api.md` in [#9680](https://github.com/encode/django-rest-framework/pull/9680)
73+
* Updated funding page to represent current scope in [#9686](https://github.com/encode/django-rest-framework/pull/9686)
74+
* Fix broken Heroku JSON Schema link in [#9693](https://github.com/encode/django-rest-framework/pull/9693)
75+
* Update Django documentation links to use stable version in [#9698](https://github.com/encode/django-rest-framework/pull/9698)
76+
* Expand docs on unique constraints cause 'required=True' in [#9725](https://github.com/encode/django-rest-framework/pull/9725)
77+
* Revert extension back from `djangorestframework-guardian2` to `djangorestframework-guardian` in [#9734](https://github.com/encode/django-rest-framework/pull/9734)
78+
* Add note to tutorial about required `request` in serializer context when using `HyperlinkedModelSerializer` in [#9732](https://github.com/encode/django-rest-framework/pull/9732)
79+
80+
#### Internal changes
81+
82+
* Update GitHub Actions to use Ubuntu 24.04 for testing in [#9677](https://github.com/encode/django-rest-framework/pull/9677)
83+
* Update test matrix to use Django 5.2 stable version in [#9679](https://github.com/encode/django-rest-framework/pull/9679)
84+
* Add `pyupgrade` to `pre-commit` hooks in [#9682](https://github.com/encode/django-rest-framework/pull/9682)
85+
* Fix test with Django 5 when `pytz` is available in [#9715](https://github.com/encode/django-rest-framework/pull/9715)
86+
87+
#### New Contributors
88+
89+
* [`@araggohnxd`](https://github.com/araggohnxd) made their first contribution in [#9673](https://github.com/encode/django-rest-framework/pull/9673)
90+
* [`@mbeijen`](https://github.com/mbeijen) made their first contribution in [#9660](https://github.com/encode/django-rest-framework/pull/9660)
91+
* [`@stefan6419846`](https://github.com/stefan6419846) made their first contribution in [#9676](https://github.com/encode/django-rest-framework/pull/9676)
92+
* [`@ren000thomas`](https://github.com/ren000thomas) made their first contribution in [#9675](https://github.com/encode/django-rest-framework/pull/9675)
93+
* [`@ulgens`](https://github.com/ulgens) made their first contribution in [#9682](https://github.com/encode/django-rest-framework/pull/9682)
94+
* [`@bukh-sal`](https://github.com/bukh-sal) made their first contribution in [#9595](https://github.com/encode/django-rest-framework/pull/9595)
95+
* [`@rezatn0934`](https://github.com/rezatn0934) made their first contribution in [#9576](https://github.com/encode/django-rest-framework/pull/9576)
96+
* [`@Rohit10jr`](https://github.com/Rohit10jr) made their first contribution in [#9693](https://github.com/encode/django-rest-framework/pull/9693)
97+
* [`@kushibayev`](https://github.com/kushibayev) made their first contribution in [#9713](https://github.com/encode/django-rest-framework/pull/9713)
98+
* [`@alihassancods`](https://github.com/alihassancods) made their first contribution in [#9732](https://github.com/encode/django-rest-framework/pull/9732)
99+
* [`@kulikjak`](https://github.com/kulikjak) made their first contribution in [#9715](https://github.com/encode/django-rest-framework/pull/9715)
100+
* [`@Natgho`](https://github.com/Natgho) made their first contribution in [#9749](https://github.com/encode/django-rest-framework/pull/9749)
101+
102+
**Full Changelog**: https://github.com/encode/django-rest-framework/compare/3.16.0...3.16.1
103+
41104
### 3.16.0
42105

43106
**Date**: 28th March 2025
44107

45108
This release is considered a significant release to improve upstream support with Django and Python. Some of these may change the behaviour of existing features and pre-existing behaviour. Specifically, some fixes were added to around the support of `UniqueConstraint` with nullable fields which will improve built-in serializer validation.
46109

47-
## Features
110+
#### Features
48111

49112
* Add official support for Django 5.1 and its new `LoginRequiredMiddleware` in [#9514](https://github.com/encode/django-rest-framework/pull/9514) and [#9657](https://github.com/encode/django-rest-framework/pull/9657)
50113
* Add official Django 5.2a1 support in [#9634](https://github.com/encode/django-rest-framework/pull/9634)
51114
* Add support for Python 3.13 in [#9527](https://github.com/encode/django-rest-framework/pull/9527) and [#9556](https://github.com/encode/django-rest-framework/pull/9556)
52115
* Support Django 2.1+ test client JSON data automatically serialized in [#6511](https://github.com/encode/django-rest-framework/pull/6511) and fix a regression in [#9615](https://github.com/encode/django-rest-framework/pull/9615)
53116

54-
## Bug fixes
117+
#### Bug fixes
55118

56119
* Fix unique together validator to respect condition's fields from `UniqueConstraint` in [#9360](https://github.com/encode/django-rest-framework/pull/9360)
57120
* Fix raising on nullable fields part of `UniqueConstraint` in [#9531](https://github.com/encode/django-rest-framework/pull/9531)
@@ -62,19 +125,19 @@ This release is considered a significant release to improve upstream support wit
62125
* Fix noisy warning and accept integers as min/max values of `DecimalField` in [#9515](https://github.com/encode/django-rest-framework/pull/9515)
63126
* Fix usages of `open()` in `setup.py` in [#9661](https://github.com/encode/django-rest-framework/pull/9661)
64127

65-
## Translations
128+
#### Translations
66129

67130
* Add some missing Chinese translations in [#9505](https://github.com/encode/django-rest-framework/pull/9505)
68131
* Fix spelling mistakes in Farsi language were corrected in [#9521](https://github.com/encode/django-rest-framework/pull/9521)
69132
* Fixing and adding missing Brazilian Portuguese translations in [#9535](https://github.com/encode/django-rest-framework/pull/9535)
70133

71-
## Removals
134+
#### Removals
72135

73136
* Remove support for Python 3.8 in [#9670](https://github.com/encode/django-rest-framework/pull/9670)
74137
* Remove long deprecated code from request wrapper in [#9441](https://github.com/encode/django-rest-framework/pull/9441)
75138
* Remove deprecated `AutoSchema._get_reference` method in [#9525](https://github.com/encode/django-rest-framework/pull/9525)
76139

77-
## Documentation and internal changes
140+
#### Documentation and internal changes
78141

79142
* Provide tests for hashing of `OperandHolder` in [#9437](https://github.com/encode/django-rest-framework/pull/9437)
80143
* Update documentation: Add `adrf` third party package in [#9198](https://github.com/encode/django-rest-framework/pull/9198)
@@ -94,7 +157,7 @@ This release is considered a significant release to improve upstream support wit
94157
* Fix a number of typos in the test suite in the docs in [#9662](https://github.com/encode/django-rest-framework/pull/9662)
95158
* Add `django-pyoidc` as a third party authentication library in [#9667](https://github.com/encode/django-rest-framework/pull/9667)
96159

97-
## New Contributors
160+
#### New Contributors
98161

99162
* [`@maerteijn`](https://github.com/maerteijn) made their first contribution in [#9198](https://github.com/encode/django-rest-framework/pull/9198)
100163
* [`@FraCata00`](https://github.com/FraCata00) made their first contribution in [#9444](https://github.com/encode/django-rest-framework/pull/9444)

0 commit comments

Comments
 (0)