<p>The <code>api_settings</code> object will check for any user-defined settings, and otherwise fall back to the default values. Any setting that uses string import paths to refer to a class will automatically import and return the referenced class, instead of the string literal.</p>
<p><em>The following settings control the basic API policies, and are applied to every <code>APIView</code> class based view, or <code>@api_view</code> function based view.</em></p>
<p>A list or tuple of renderer classes, that determines the default set of renderers that may be used when returning a <code>Response</code> object.</p>
<p>A list or tuple of authentication classes, that determines the default set of authenticators used when accessing the <code>request.user</code> or <code>request.auth</code> properties.</p>
<p>A list or tuple of permission classes, that determines the default set of permissions checked at the start of a view. Permission must be granted by every class in the list.</p>
<p><strong>This setting is pending deprecation.</strong></p>
<p>See the pagination documentation for further guidance on <ahref="../pagination/#modifying-the-pagination-style">setting the pagination style</a>.</p>
<p>The name of a query parameter, which can be used by the client to override the default page size to use for pagination. If set to <code>None</code>, clients may not override the default page size.</p>
<p><strong>This setting is pending deprecation.</strong></p>
<p>See the pagination documentation for further guidance on <ahref="../pagination/#modifying-the-pagination-style">setting the pagination style</a>.</p>
<p>The value that should be used for <code>request.version</code> when no versioning information is present.</p>
<p>Default: <code>None</code></p>
<h4id="allowed_versions">ALLOWED_VERSIONS</h4>
<p>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.</p>
<p>Default: <code>None</code></p>
<h4id="version_parameter">VERSION_PARAMETER</h4>
<p>The string that should used for any versioning parameters, such as in the media type or URL query parameters.</p>
<p>The renderer classes that are supported when building test requests.</p>
<p>The format of any of these renderer classes may be used when constructing a test request, for example: <code>client.post('/users', {'username': 'jamie'}, format='json')</code></p>
<p>The name of a form field that may be used to override the content of the form payload. Must be used together with <code>FORM_CONTENTTYPE_OVERRIDE</code>.</p>
<p>If either setting is <code>None</code> then form content overloading will be disabled.</p>
<p>The name of a form field that may be used to override the content type of the form payload. Must be used together with <code>FORM_CONTENT_OVERRIDE</code>.</p>
<p>If either setting is <code>None</code> then form content overloading will be disabled.</p>
<h2id="date-and-time-formatting">Date and time formatting</h2>
<p><em>The following settings are used to control how date and time representations may be parsed and rendered.</em></p>
<h4id="datetime_format">DATETIME_FORMAT</h4>
<p>A format string that should be used by default for rendering the output of <code>DateTimeField</code> serializer fields. If <code>None</code>, then <code>DateTimeField</code> serializer fields will return Python <code>datetime</code> objects, and the datetime encoding will be determined by the renderer.</p>
<p>May be any of <code>None</code>, <code>'iso-8601'</code> or a Python <ahref="http://docs.python.org/2/library/time.html#time.strftime">strftime format</a> string.</p>
<p>A list of format strings that should be used by default for parsing inputs to <code>DateTimeField</code> serializer fields.</p>
<p>May be a list including the string <code>'iso-8601'</code> or Python <ahref="http://docs.python.org/2/library/time.html#time.strftime">strftime format</a> strings.</p>
<p>Default: <code>['iso-8601']</code></p>
<h4id="date_format">DATE_FORMAT</h4>
<p>A format string that should be used by default for rendering the output of <code>DateField</code> serializer fields. If <code>None</code>, then <code>DateField</code> serializer fields will return Python <code>date</code> objects, and the date encoding will be determined by the renderer.</p>
<p>May be any of <code>None</code>, <code>'iso-8601'</code> or a Python <ahref="http://docs.python.org/2/library/time.html#time.strftime">strftime format</a> string.</p>
<p>A list of format strings that should be used by default for parsing inputs to <code>DateField</code> serializer fields.</p>
<p>May be a list including the string <code>'iso-8601'</code> or Python <ahref="http://docs.python.org/2/library/time.html#time.strftime">strftime format</a> strings.</p>
<p>Default: <code>['iso-8601']</code></p>
<h4id="time_format">TIME_FORMAT</h4>
<p>A format string that should be used by default for rendering the output of <code>TimeField</code> serializer fields. If <code>None</code>, then <code>TimeField</code> serializer fields will return Python <code>time</code> objects, and the time encoding will be determined by the renderer.</p>
<p>May be any of <code>None</code>, <code>'iso-8601'</code> or a Python <ahref="http://docs.python.org/2/library/time.html#time.strftime">strftime format</a> string.</p>
<p>A list of format strings that should be used by default for parsing inputs to <code>TimeField</code> serializer fields.</p>
<p>May be a list including the string <code>'iso-8601'</code> or Python <ahref="http://docs.python.org/2/library/time.html#time.strftime">strftime format</a> strings.</p>
<p>When set to <code>True</code>, JSON responses will allow unicode characters in responses. For example:</p>
<pre><code>{"unicode black star":"★"}
</code></pre>
<p>When set to <code>False</code>, JSON responses will escape non-ascii characters, like so:</p>
<pre><code>{"unicode black star":"\u2605"}
</code></pre>
<p>Both styles conform to <ahref="http://www.ietf.org/rfc/rfc4627.txt">RFC 4627</a>, and are syntactically valid JSON. The unicode style is preferred as being more user-friendly when inspecting API responses.</p>
<p>Default: <code>True</code></p>
<h4id="compact_json">COMPACT_JSON</h4>
<p>When set to <code>True</code>, JSON responses will return compact representations, with no spacing after <code>':'</code> and <code>','</code> characters. For example:</p>
<p>The default style is to return minified responses, in line with <ahref="https://github.com/interagent/http-api-design#keep-json-minified-in-all-responses">Heroku's API design guidelines</a>.</p>
<p>When returning decimal objects in API representations that do not support a native decimal type, it is normally best to return the value as a string. This avoids the loss of precision that occurs with binary floating point implementations.</p>
<p>When set to <code>True</code>, the serializer <code>DecimalField</code> class will return strings instead of <code>Decimal</code> objects. When set to <code>False</code>, serializers will return <code>Decimal</code> objects, which the default JSON encoder will return as floats.</p>
<h2id="view-names-and-descriptions">View names and descriptions</h2>
<p><strong>The following settings are used to generate the view names and descriptions, as used in responses to <code>OPTIONS</code> requests, and as used in the browsable API.</strong></p>
<li><code>cls</code>: The view class. Typically the name function would inspect the name of the class when generating a descriptive name, by accessing <code>cls.__name__</code>.</li>
<li><code>suffix</code>: The optional suffix used when differentiating individual views in a viewset.</li>
<p>A string representing the function that should be used when generating view descriptions.</p>
<p>This setting can be changed to support markup styles other than the default markdown. For example, you can use it to support <code>rst</code> markup in your view docstrings being output in the browsable API.</p>
<p>This should be a function with the following signature:</p>
<li><code>cls</code>: The view class. Typically the description function would inspect the docstring of the class when generating a description, by accessing <code>cls.__doc__</code></li>
<li><code>html</code>: A boolean indicating if HTML output is required. <code>True</code> when used in the browsable API, and <code>False</code> when used in generating <code>OPTIONS</code> responses.</li>
<p>A string representing the function that should be used when returning a response for any given exception. If the function returns <code>None</code>, a 500 error will be raised.</p>
<p>This setting can be changed to support error responses other than the default <code>{"detail": "Failure..."}</code> responses. For example, you can use it to provide API responses like <code>{"errors": [{"message": "Failure...", "code": ""} ...]}</code>.</p>
<p>This should be a function with the following signature:</p>
<p>An integer of 0 or more, that may be used to specify the number of application proxies that the API runs behind. This allows throttling to more accurately identify client IP addresses. If set to <code>None</code> then less strict IP matching will be used by the throttle classes.</p>