Skip to content

Commit 4471c05

Browse files
committed
Merge remote-tracking branch 'origin/fix_instance_check' into fix_instance_check
2 parents 0d46e58 + c9b6b02 commit 4471c05

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+579
-506
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
- '3.8'
2020
- '3.9'
2121
- '3.10'
22+
- '3.11'
2223

2324
steps:
2425
- uses: actions/checkout@v3

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ There is a live example API for testing purposes, [available here][sandbox].
5454

5555
# Requirements
5656

57-
* Python (3.6, 3.7, 3.8, 3.9, 3.10)
58-
* Django (2.2, 3.0, 3.1, 3.2, 4.0, 4.1)
57+
* Python 3.6+
58+
* Django 4.1, 4.0, 3.2, 3.1, 3.0
5959

6060
We **highly recommend** and only officially support the latest patch release of
6161
each Python and Django series.

docs/api-guide/authentication.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ The `curl` command line tool may be useful for testing token authenticated APIs.
173173

174174
---
175175

176-
#### Generating Tokens
176+
### Generating Tokens
177177

178-
##### By using signals
178+
#### By using signals
179179

180180
If you want every user to have an automatically generated Token, you can simply catch the User's `post_save` signal.
181181

@@ -199,9 +199,9 @@ If you've already created some users, you can generate tokens for all existing u
199199
for user in User.objects.all():
200200
Token.objects.get_or_create(user=user)
201201

202-
##### By exposing an api endpoint
202+
#### By exposing an api endpoint
203203

204-
When using `TokenAuthentication`, you may want to provide a mechanism for clients to obtain a token given the username and password. REST framework provides a built-in view to provide this behaviour. To use it, add the `obtain_auth_token` view to your URLconf:
204+
When using `TokenAuthentication`, you may want to provide a mechanism for clients to obtain a token given the username and password. REST framework provides a built-in view to provide this behavior. To use it, add the `obtain_auth_token` view to your URLconf:
205205

206206
from rest_framework.authtoken import views
207207
urlpatterns += [
@@ -216,7 +216,7 @@ The `obtain_auth_token` view will return a JSON response when valid `username` a
216216

217217
Note that the default `obtain_auth_token` view explicitly uses JSON requests and responses, rather than using default renderer and parser classes in your settings.
218218

219-
By default, there are no permissions or throttling applied to the `obtain_auth_token` view. If you do wish to apply to throttle you'll need to override the view class,
219+
By default, there are no permissions or throttling applied to the `obtain_auth_token` view. If you do wish to apply throttling you'll need to override the view class,
220220
and include them using the `throttle_classes` attribute.
221221

222222
If you need a customized version of the `obtain_auth_token` view, you can do so by subclassing the `ObtainAuthToken` view class, and using that in your url conf instead.
@@ -248,9 +248,9 @@ And in your `urls.py`:
248248
]
249249

250250

251-
##### With Django admin
251+
#### With Django admin
252252

253-
It is also possible to create Tokens manually through the admin interface. In case you are using a large user base, we recommend that you monkey patch the `TokenAdmin` class customize it to your needs, more specifically by declaring the `user` field as `raw_field`.
253+
It is also possible to create Tokens manually through the admin interface. In case you are using a large user base, we recommend that you monkey patch the `TokenAdmin` class to customize it to your needs, more specifically by declaring the `user` field as `raw_field`.
254254

255255
`your_app/admin.py`:
256256

@@ -289,7 +289,7 @@ If you're using an AJAX-style API with SessionAuthentication, you'll need to mak
289289

290290
**Warning**: Always use Django's standard login view when creating login pages. This will ensure your login views are properly protected.
291291

292-
CSRF validation in REST framework works slightly differently from standard Django due to the need to support both session and non-session based authentication to the same views. This means that only authenticated requests require CSRF tokens, and anonymous requests may be sent without CSRF tokens. This behaviour is not suitable for login views, which should always have CSRF validation applied.
292+
CSRF validation in REST framework works slightly differently from standard Django due to the need to support both session and non-session based authentication to the same views. This means that only authenticated requests require CSRF tokens, and anonymous requests may be sent without CSRF tokens. This behavior is not suitable for login views, which should always have CSRF validation applied.
293293

294294

295295
## RemoteUserAuthentication
@@ -299,15 +299,15 @@ environment variable.
299299

300300
To use it, you must have `django.contrib.auth.backends.RemoteUserBackend` (or a subclass) in your
301301
`AUTHENTICATION_BACKENDS` setting. By default, `RemoteUserBackend` creates `User` objects for usernames that don't
302-
already exist. To change this and other behaviour, consult the
302+
already exist. To change this and other behavior, consult the
303303
[Django documentation](https://docs.djangoproject.com/en/stable/howto/auth-remote-user/).
304304

305305
If successfully authenticated, `RemoteUserAuthentication` provides the following credentials:
306306

307307
* `request.user` will be a Django `User` instance.
308308
* `request.auth` will be `None`.
309309

310-
Consult your web server's documentation for information about configuring an authentication method, e.g.:
310+
Consult your web server's documentation for information about configuring an authentication method, for example:
311311

312312
* [Apache Authentication How-To](https://httpd.apache.org/docs/2.4/howto/auth.html)
313313
* [NGINX (Restricting Access)](https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-http-basic-authentication/)
@@ -338,7 +338,7 @@ If the `.authenticate_header()` method is not overridden, the authentication sch
338338

339339
The following example will authenticate any incoming request as the user given by the username in a custom request header named 'X-USERNAME'.
340340

341-
from django.contrib.auth.models import User
341+
from django.contrib.auth.models import User
342342
from rest_framework import authentication
343343
from rest_framework import exceptions
344344

@@ -369,7 +369,7 @@ The following third-party packages are also available.
369369

370370
The [Django OAuth Toolkit][django-oauth-toolkit] package provides OAuth 2.0 support and works with Python 3.4+. The package is maintained by [jazzband][jazzband] and uses the excellent [OAuthLib][oauthlib]. The package is well documented, and well supported and is currently our **recommended package for OAuth 2.0 support**.
371371

372-
#### Installation & configuration
372+
### Installation & configuration
373373

374374
Install using `pip`.
375375

@@ -396,7 +396,7 @@ The [Django REST framework OAuth][django-rest-framework-oauth] package provides
396396

397397
This package was previously included directly in the REST framework but is now supported and maintained as a third-party package.
398398

399-
#### Installation & configuration
399+
### Installation & configuration
400400

401401
Install the package using `pip`.
402402

@@ -418,7 +418,7 @@ HTTP Signature (currently a [IETF draft][http-signature-ietf-draft]) provides a
418418

419419
## Djoser
420420

421-
[Djoser][djoser] library provides a set of views to handle basic actions such as registration, login, logout, password reset and account activation. The package works with a custom user model and uses token-based authentication. This is ready to use REST implementation of the Django authentication system.
421+
[Djoser][djoser] library provides a set of views to handle basic actions such as registration, login, logout, password reset and account activation. The package works with a custom user model and uses token-based authentication. This is a ready to use REST implementation of the Django authentication system.
422422

423423
## django-rest-auth / dj-rest-auth
424424

docs/api-guide/content-negotiation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ The default content negotiation class may be set globally, using the `DEFAULT_CO
8282

8383
You can also set the content negotiation used for an individual view, or viewset, using the `APIView` class-based views.
8484

85-
from myapp.negotiation import IgnoreClientContentNegotiation
85+
from myapp.negotiation import IgnoreClientContentNegotiation
8686
from rest_framework.response import Response
8787
from rest_framework.views import APIView
8888

0 commit comments

Comments
 (0)