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
*`format` - A string representing the output format. If not specified, the `DATETIME_FORMAT` setting will be used, which defaults to `'iso-8601'`.
203
+
*`input_formats` - A list of strings representing the input formats which may be used to parse the date. If not specified, the `DATETIME_INPUT_FORMATS` setting will be used, which defaults to `['iso-8601']`.
204
+
205
+
DateTime format strings may either be [python strftime formats][strftime] which explicitly specifiy the format, or the special string `'iso-8601'`, which indicates that [ISO 8601][iso8601] style datetimes should be used. (eg `'2013-01-29T12:34:56.000000'`)
206
+
207
+
## DateField
208
+
209
+
A date representation.
210
+
211
+
Corresponds to `django.db.models.fields.DateField`
*`format` - A string representing the output format. If not specified, the `DATE_FORMAT` setting will be used, which defaults to `'iso-8601'`.
216
+
*`input_formats` - A list of strings representing the input formats which may be used to parse the date. If not specified, the `DATE_INPUT_FORMATS` setting will be used, which defaults to `['iso-8601']`.
217
+
218
+
Date format strings may either be [python strftime formats][strftime] which explicitly specifiy the format, or the special string `'iso-8601'`, which indicates that [ISO 8601][iso8601] style dates should be used. (eg `'2013-01-29'`)
219
+
206
220
## TimeField
207
221
208
222
A time representation.
209
223
224
+
Optionally takes `format` as parameter to replace the matching pattern.
225
+
210
226
Corresponds to `django.db.models.fields.TimeField`
*`format` - A string representing the output format. If not specified, the `TIME_FORMAT` setting will be used, which defaults to `'iso-8601'`.
231
+
*`input_formats` - A list of strings representing the input formats which may be used to parse the date. If not specified, the `TIME_INPUT_FORMATS` setting will be used, which defaults to `['iso-8601']`.
232
+
233
+
Time format strings may either be [python strftime formats][strftime] which explicitly specifiy the format, or the special string `'iso-8601'`, which indicates that [ISO 8601][iso8601] style times should be used. (eg `'12:34:56.000000'`)
234
+
212
235
## IntegerField
213
236
214
237
An integer representation.
@@ -252,3 +275,5 @@ Django's regular [FILE_UPLOAD_HANDLERS] are used for handling uploaded files.
Copy file name to clipboardExpand all lines: docs/api-guide/settings.md
+87-19Lines changed: 87 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,11 @@ The `api_settings` object will check for any user-defined settings, and otherwis
34
34
35
35
# API Reference
36
36
37
-
## DEFAULT_RENDERER_CLASSES
37
+
## API policy settings
38
+
39
+
*The following settings control the basic API policies, and are applied to every `APIView` class based view, or `@api_view` function based view.*
40
+
41
+
#### DEFAULT_RENDERER_CLASSES
38
42
39
43
A list or tuple of renderer classes, that determines the default set of renderers that may be used when returning a `Response` object.
40
44
@@ -45,7 +49,7 @@ Default:
45
49
'rest_framework.renderers.BrowsableAPIRenderer',
46
50
)
47
51
48
-
## DEFAULT_PARSER_CLASSES
52
+
####DEFAULT_PARSER_CLAS
F438
SES
49
53
50
54
A list or tuple of parser classes, that determines the default set of parsers used when accessing the `request.DATA` property.
51
55
@@ -57,7 +61,7 @@ Default:
57
61
'rest_framework.parsers.MultiPartParser'
58
62
)
59
63
60
-
## DEFAULT_AUTHENTICATION_CLASSES
64
+
####DEFAULT_AUTHENTICATION_CLASSES
61
65
62
66
A list or tuple of authentication classes, that determines the default set of authenticators used when accessing the `request.user` or `request.auth` properties.
*The following settings control the behavior of the generic class based views.*
102
+
103
+
#### DEFAULT_MODEL_SERIALIZER_CLASS
94
104
95
105
A class that determines the default type of model serializer that should be used by a generic view if `model` is specified, but `serializer_class` is not provided.
The filter backend class that should be used for generic filtering. If set to `None` then generic filtering is disabled.
108
118
109
-
## PAGINATE_BY
119
+
####PAGINATE_BY
110
120
111
121
The default page size to use for pagination. If set to `None`, pagination is disabled by default.
112
122
113
123
Default: `None`
114
124
115
-
## PAGINATE_BY_PARAM
125
+
####PAGINATE_BY_PARAM
116
126
117
127
The name of a query parameter, which can be used by the client to overide the default page size to use for pagination. If set to `None`, clients may not override the default page size.
118
128
119
129
Default: `None`
120
130
121
-
## UNAUTHENTICATED_USER
131
+
---
132
+
133
+
## Authentication settings
134
+
135
+
*The following settings control the behavior of unauthenticated requests.*
136
+
137
+
#### UNAUTHENTICATED_USER
122
138
123
139
The class that should be used to initialize `request.user` for unauthenticated requests.
Copy file name to clipboardExpand all lines: docs/index.md
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -133,6 +133,10 @@ Run the tests:
133
133
134
134
./rest_framework/runtests/runtests.py
135
135
136
+
To run the tests against all supported configurations, first install [the tox testing tool][tox] globally, using `pip install tox`, then simply run `tox`:
137
+
138
+
tox
139
+
136
140
## Support
137
141
138
142
For support please see the [REST framework discussion group][group], try the `#restframework` channel on `irc.freenode.net`, or raise a question on [Stack Overflow][stack-overflow], making sure to include the ['django-rest-framework'][django-rest-framework-tag] tag.
@@ -218,6 +222,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copy file name to clipboardExpand all lines: docs/topics/release-notes.md
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,8 @@ You can determine your currently installed version using `pip freeze`:
42
42
<
A107
br>
43
43
### Master
44
44
45
-
* Request authentication is no longer lazily evaluated, instead authentication is always run, which results in more consistent, obvious behavior. Eg. Supplying bad auth credentials will now always return an error response, even if no permissions are set on the view.
45
+
* Support for custom input and output formats for `DateField`, `DateTimeField` and `TimeField`.
46
+
* Cleanup: Request authentication is no longer lazily evaluated, instead authentication is always run, which results in more consistent, obvious behavior. Eg. Supplying bad auth credentials will now always return an error response, even if no permissions are set on the view.
46
47
* Bugfix for serializer data being uncacheable with pickle protocol 0.
47
48
* Bugfixes for model field validation edge-cases.
48
49
* Bugfix for authtoken migration while using a custom user model and south.
0 commit comments