From e628d9eb9b7deac2ecffe23eace5c72709887f8f Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 6 Mar 2015 12:05:16 +0000 Subject: Update documentation --- api-guide/settings/index.html | 49 ++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 21 deletions(-) (limited to 'api-guide/settings/index.html') diff --git a/api-guide/settings/index.html b/api-guide/settings/index.html index f3062be6..ac100eb4 100644 --- a/api-guide/settings/index.html +++ b/api-guide/settings/index.html @@ -188,6 +188,10 @@ Pagination +
For example your project's settings.py file might include something like this:
REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
- 'rest_framework.renderers.YAMLRenderer',
+ 'rest_framework.renderers.JSONRenderer',
),
'DEFAULT_PARSER_CLASSES': (
- 'rest_framework.parsers.YAMLParser',
+ 'rest_framework.parsers.JSONParser',
)
}
@@ -534,6 +530,17 @@ If set to None then generic filtering is disabled.
The name of a query parameter, which can be used to specify the ordering of results returned by OrderingFilter.
Default: ordering
The value that should be used for request.version when no versioning information is present.
Default: None
If set, this value will restrict the set of versions that may be returned by the versioning scheme, and will raise an error if the provided version if not in this set.
+Default: None
The string that should used for any versioning parameters, such as in the media type or URL query parameters.
+Default: 'version'
The following settings control the behavior of unauthenticated requests.
None then generic filtering is disabled.
A string representing the function that should be used when returning a response for any given exception. If the function returns None, a 500 error will be raised.
This setting can be changed to support error responses other than the default {"detail": "Failure..."} responses. For example, you can use it to provide API responses like {"errors": [{"message": "Failure...", "code": ""} ...]}.
This should be a function with the following signature:
-exception_handler(exc)
+exception_handler(exc, context)
exc: The exception.
--
cgit v1.2.3