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 +
  • + Versioning +
  • +
  • Content negotiation
  • @@ -231,6 +235,10 @@ Documenting your API +
  • + Internationalization +
  • +
  • AJAX, CSRF & CORS
  • @@ -260,23 +268,11 @@
  • - 2.0 Announcement -
  • - -
  • - 2.2 Announcement -
  • - -
  • - 2.3 Announcement -
  • - -
  • - 2.4 Announcement + 3.0 Announcement
  • - 3.0 Announcement + 3.1 Announcement
  • @@ -287,10 +283,6 @@ Release Notes
  • -
  • - Credits -
  • - @@ -377,6 +369,10 @@ Generic view settings +
  • + Versioning settings +
  • +
  • Authentication settings
  • @@ -433,10 +429,10 @@

    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


    +

    Versioning settings

    +

    DEFAULT_VERSION

    +

    The value that should be used for request.version when no versioning information is present.

    +

    Default: None

    +

    ALLOWED_VERSIONS

    +

    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

    +

    VERSION_PARAMETER

    +

    The string that should used for any versioning parameters, such as in the media type or URL query parameters.

    +

    Default: 'version'

    +

    Authentication settings

    The following settings control the behavior of unauthenticated requests.

    UNAUTHENTICATED_USER

    @@ -661,7 +668,7 @@ If set to 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)