You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api-guide/authentication.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -201,7 +201,7 @@ If you've already created some users, you can generate tokens for all existing u
201
201
202
202
#### By exposing an api endpoint
203
203
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:
205
205
206
206
from rest_framework.authtoken import views
207
207
urlpatterns += [
@@ -216,7 +216,7 @@ The `obtain_auth_token` view will return a JSON response when valid `username` a
216
216
217
217
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.
218
218
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,
220
220
and include them using the `throttle_classes` attribute.
221
221
222
222
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.
@@ -250,7 +250,7 @@ And in your `urls.py`:
250
250
251
251
#### With Django admin
252
252
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`.
254
254
255
255
`your_app/admin.py`:
256
256
@@ -289,7 +289,7 @@ If you're using an AJAX-style API with SessionAuthentication, you'll need to mak
289
289
290
290
**Warning**: Always use Django's standard login view when creating login pages. This will ensure your login views are properly protected.
291
291
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.
293
293
294
294
295
295
## RemoteUserAuthentication
@@ -299,15 +299,15 @@ environment variable.
299
299
300
300
To use it, you must have `django.contrib.auth.backends.RemoteUserBackend` (or a subclass) in your
301
301
`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
@@ -418,7 +418,7 @@ HTTP Signature (currently a [IETF draft][http-signature-ietf-draft]) provides a
418
418
419
419
## Djoser
420
420
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.
Copy file name to clipboardExpand all lines: docs/api-guide/fields.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ Defaults to `True`. If you're using [Model Serializer](https://www.django-rest-f
46
46
47
47
### `default`
48
48
49
-
If set, this gives the default value that will be used for the field if no input value is supplied. If not set the default behaviour is to not populate the attribute at all.
49
+
If set, this gives the default value that will be used for the field if no input value is supplied. If not set the default behavior is to not populate the attribute at all.
50
50
51
51
The `default` is not applied during partial update operations. In the partial update case only fields that are provided in the incoming data will have a validated value returned.
52
52
@@ -85,7 +85,7 @@ When serializing fields with dotted notation, it may be necessary to provide a `
would require user object to be fetched from database when it is not prefetched. If that is not wanted, be sure to be using `prefetch_related` and `select_related` methods appropriately. For more information about the methods refer to [django documentation][django-docs-select-related].
88
+
This case would require user object to be fetched from database when it is not prefetched. If that is not wanted, be sure to be using `prefetch_related` and `select_related` methods appropriately. For more information about the methods refer to [django documentation][django-docs-select-related].
89
89
90
90
The value `source='*'` has a special meaning, and is used to indicate that the entire object should be passed through to the field. This can be useful for creating nested representations, or for fields which require access to the complete object in order to determine the output representation.
91
91
@@ -151,7 +151,7 @@ Prior to Django 2.1 `models.BooleanField` fields were always `blank=True`. Thus
151
151
since Django 2.1 default `serializers.BooleanField` instances will be generated
152
152
without the `required` kwarg (i.e. equivalent to `required=True`) whereas with
153
153
previous versions of Django, default `BooleanField` instances will be generated
154
-
with a `required=False` option. If you want to control this behaviour manually,
154
+
with a `required=False` option. If you want to control this behavior manually,
155
155
explicitly declare the `BooleanField` on the serializer class, or use the
156
156
`extra_kwargs` option to set the `required` flag.
157
157
@@ -771,7 +771,7 @@ Here the mapping between the target and source attribute pairs (`x` and
771
771
`x_coordinate`, `y` and `y_coordinate`) is handled in the `IntegerField`
772
772
declarations. It's our `NestedCoordinateSerializer` that takes `source='*'`.
773
773
774
-
Our new `DataPointSerializer` exhibits the same behaviour as the custom field
774
+
Our new `DataPointSerializer` exhibits the same behavior as the custom field
775
775
approach.
776
776
777
777
Serializing:
@@ -831,7 +831,7 @@ the [djangorestframework-recursive][djangorestframework-recursive] package provi
831
831
832
832
## django-rest-framework-gis
833
833
834
-
The [django-rest-framework-gis][django-rest-framework-gis] package provides geographic addons for django rest framework like a `GeometryField` field and a GeoJSON serializer.
834
+
The [django-rest-framework-gis][django-rest-framework-gis] package provides geographic addons for django rest framework like a `GeometryField` field and a GeoJSON serializer.
Copy file name to clipboardExpand all lines: docs/api-guide/format-suffixes.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -23,8 +23,8 @@ Returns a URL pattern list which includes format suffix patterns appended to eac
23
23
Arguments:
24
24
25
25
***urlpatterns**: Required. A URL pattern list.
26
-
***suffix_required**: Optional. A boolean indicating if suffixes in the URLs should be optional or mandatory. Defaults to `False`, meaning that suffixes are optional by default.
27
-
***allowed**: Optional. A list or tuple of valid format suffixes. If not provided, a wildcard format suffix pattern will be used.
26
+
***suffix_required**: Optional. A boolean indicating if suffixes in the URLs should be optional or mandatory. Defaults to `False`, meaning that suffixes are optional by default.
27
+
***allowed**: Optional. A list or tuple of valid format suffixes. If not provided, a wildcard format suffix pattern will be used.
Copy file name to clipboardExpand all lines: docs/api-guide/generic-views.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ For example:
98
98
99
99
---
100
100
101
-
**Note:** If the serializer_class used in the generic view spans orm relations, leading to an n+1 problem, you could optimize your queryset in this method using `select_related` and `prefetch_related`. To get more information about n+1 problem and use cases of the mentioned methods refer to related section in [django documentation][django-docs-select-related].
101
+
**Note:** If the `serializer_class` used in the generic view spans orm relations, leading to an n+1 problem, you could optimize your queryset in this method using `select_related` and `prefetch_related`. To get more information about n+1 problem and use cases of the mentioned methods refer to related section in [django documentation][django-docs-select-related].
Copy file name to clipboardExpand all lines: docs/api-guide/pagination.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -227,7 +227,7 @@ Note that the `paginate_queryset` method may set state on the pagination instanc
227
227
228
228
## Example
229
229
230
-
Suppose we want to replace the default pagination output style with a modified format that includes the next and previous links under in a nested 'links' key. We could specify a custom pagination class like so:
230
+
Suppose we want to replace the default pagination output style with a modified format that includes the next and previous links under in a nested 'links' key. We could specify a custom pagination class like so:
231
231
232
232
class CustomPagination(pagination.PageNumberPagination):
Copy file name to clipboardExpand all lines: docs/api-guide/parsers.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ REST framework includes a number of built in Parser classes, that allow you to a
15
15
16
16
## How the parser is determined
17
17
18
-
The set of valid parsers for a view is always defined as a list of classes. When `request.data` is accessed, REST framework will examine the `Content-Type` header on the incoming request, and determine which parser to use to parse the request content.
18
+
The set of valid parsers for a view is always defined as a list of classes. When `request.data` is accessed, REST framework will examine the `Content-Type` header on the incoming request, and determine which parser to use to parse the request content.
Copy file name to clipboardExpand all lines: docs/api-guide/permissions.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -177,7 +177,7 @@ This permission class ties into Django's standard `django.contrib.auth` [model p
177
177
*`PUT` and `PATCH` requests require the user to have the `change` permission on the model.
178
178
*`DELETE` requests require the user to have the `delete` permission on the model.
179
179
180
-
The default behaviour can also be overridden to support custom model permissions. For example, you might want to include a `view` model permission for `GET` requests.
180
+
The default behavior can also be overridden to support custom model permissions. For example, you might want to include a `view` model permission for `GET` requests.
181
181
182
182
To use custom model permissions, override `DjangoModelPermissions` and set the `.perms_map` property. Refer to the source code for details.
Copy file name to clipboardExpand all lines: docs/api-guide/relations.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -246,7 +246,7 @@ When using `SlugRelatedField` as a read-write field, you will normally want to e
246
246
247
247
## HyperlinkedIdentityField
248
248
249
-
This field can be applied as an identity relationship, such as the `'url'` field on a HyperlinkedModelSerializer. It can also be used for an attribute on the object. For example, the following serializer:
249
+
This field can be applied as an identity relationship, such as the `'url'` field on a HyperlinkedModelSerializer. It can also be used for an attribute on the object. For example, the following serializer:
250
250
251
251
class AlbumSerializer(serializers.HyperlinkedModelSerializer):
Copy file name to clipboardExpand all lines: docs/api-guide/renderers.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -105,7 +105,7 @@ The TemplateHTMLRenderer will create a `RequestContext`, using the `response.dat
105
105
106
106
---
107
107
108
-
**Note:** When used with a view that makes use of a serializer the `Response` sent for rendering may not be a dictionary and will need to be wrapped in a dict before returning to allow the TemplateHTMLRenderer to render it. For example:
108
+
**Note:** When used with a view that makes use of a serializer the `Response` sent for rendering may not be a dictionary and will need to be wrapped in a dict before returning to allow the `TemplateHTMLRenderer` to render it. For example:
109
109
110
110
```
111
111
response.data = {'results': response.data}
@@ -192,7 +192,7 @@ By default the response content will be rendered with the highest priority rende
192
192
def get_default_renderer(self, view):
193
193
return JSONRenderer()
194
194
195
-
## AdminRenderer
195
+
## AdminRenderer
196
196
197
197
Renders data into HTML for an admin-like display:
198
198
@@ -332,7 +332,7 @@ You can do some pretty flexible things using REST framework's renderers. Some e
332
332
* Specify multiple types of HTML representation for API clients to use.
333
333
* Underspecify a renderer's media type, such as using `media_type = 'image/*'`, and use the `Accept` header to vary the encoding of the response.
334
334
335
-
## Varying behaviour by media type
335
+
## Varying behavior by media type
336
336
337
337
In some cases you might want your view to use different serialization styles depending on the accepted media type. If you need to do this you can access `request.accepted_renderer` to determine the negotiated renderer that will be used for the response.
Copy file name to clipboardExpand all lines: docs/api-guide/requests.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ If a client sends a request with a content-type that cannot be parsed then a `Un
49
49
50
50
# Content negotiation
51
51
52
-
The request exposes some properties that allow you to determine the result of the content negotiation stage. This allows you to implement behaviour such as selecting a different serialization schemes for different media types.
52
+
The request exposes some properties that allow you to determine the result of the content negotiation stage. This allows you to implement behavior such as selecting a different serialization schemes for different media types.
0 commit comments