From b9719fc7637e00b08c5ca9294b5a294d87035952 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 29 Jul 2019 13:57:14 +0000 Subject: [PATCH] Deployed 0e1c5d31 with MkDocs version: 1.0.4 --- api-guide/authentication/index.html | 2 +- api-guide/filtering/index.html | 2 +- api-guide/permissions/index.html | 2 +- api-guide/requests/index.html | 2 +- api-guide/serializers/index.html | 4 +- community/release-notes/index.html | 12 ++ community/third-party-packages/index.html | 2 +- coreapi/schemas/index.html | 2 +- search/search_index.json | 2 +- sitemap.xml | 128 +++++++++++----------- sitemap.xml.gz | Bin 751 -> 752 bytes topics/documenting-your-api/index.html | 2 +- 12 files changed, 86 insertions(+), 74 deletions(-) diff --git a/api-guide/authentication/index.html b/api-guide/authentication/index.html index cf302dfce..b2059f32d 100644 --- a/api-guide/authentication/index.html +++ b/api-guide/authentication/index.html @@ -755,7 +755,7 @@ already exist. To change this and other behaviour, consult the

You may also override the .authenticate_header(self, request) method. If implemented, it should return a string that will be used as the value of the WWW-Authenticate header in a HTTP 401 Unauthorized response.

If the .authenticate_header() method is not overridden, the authentication scheme will return HTTP 403 Forbidden responses when an unauthenticated request is denied access.


-

Note: When your custom authenticator is invoked by the request object's .user or .auth properties, you may see an AttributeError re-raised as a WrappedAttributeError. This is necessary to prevent the original exception from being suppressed by the outer property access. Python will not recognize that the AttributeError orginates from your custom authenticator and will instead assume that the request object does not have a .user or .auth property. These errors should be fixed or otherwise handled by your authenticator.

+

Note: When your custom authenticator is invoked by the request object's .user or .auth properties, you may see an AttributeError re-raised as a WrappedAttributeError. This is necessary to prevent the original exception from being suppressed by the outer property access. Python will not recognize that the AttributeError originates from your custom authenticator and will instead assume that the request object does not have a .user or .auth property. These errors should be fixed or otherwise handled by your authenticator.


Example

The following example will authenticate any incoming request as the user given by the username in a custom request header named 'X-USERNAME'.

diff --git a/api-guide/filtering/index.html b/api-guide/filtering/index.html index fc4318dfd..1320ca723 100644 --- a/api-guide/filtering/index.html +++ b/api-guide/filtering/index.html @@ -681,7 +681,7 @@ class UserListView(generics.ListAPIView):

For example:

search_fields = ['=username', '=email']
 
-

By default, the search parameter is named 'search', but this may be overridden with the SEARCH_PARAM setting.

+

By default, the search parameter is named 'search', but this may be overridden with the SEARCH_PARAM setting.

To dynamically change search fields based on request content, it's possible to subclass the SearchFilter and override the get_search_fields() function. For example, the following subclass will only search on title if the query parameter title_only is in the request:

from rest_framework import filters
 
diff --git a/api-guide/permissions/index.html b/api-guide/permissions/index.html
index 5a26daf48..ad19b9aee 100644
--- a/api-guide/permissions/index.html
+++ b/api-guide/permissions/index.html
@@ -725,7 +725,7 @@ class BlacklistPermission(permissions.BasePermission):
 

Third party packages

The following third party packages are also available.

DRF - Access Policy

-

The Django REST - Access Policy package provides a way to define complex access rules in declaritive policy classes that are attached to view sets or function-based views. The policies are defined in JSON in a format similar to AWS' Identity & Access Management policies.

+

The Django REST - Access Policy package provides a way to define complex access rules in declarative policy classes that are attached to view sets or function-based views. The policies are defined in JSON in a format similar to AWS' Identity & Access Management policies.

Composed Permissions

The Composed Permissions package provides a simple way to define complex and multi-depth (with logic operators) permission objects, using small and reusable components.

REST Condition

diff --git a/api-guide/requests/index.html b/api-guide/requests/index.html index 0d8b57fb3..c8c814048 100644 --- a/api-guide/requests/index.html +++ b/api-guide/requests/index.html @@ -553,7 +553,7 @@

The APIView class or @api_view decorator will ensure that this property is automatically set to a list of Authentication instances, based on the authentication_classes set on the view or based on the DEFAULT_AUTHENTICATORS setting.

You won't typically need to access this property.


-

Note: You may see a WrappedAttributeError raised when calling the .user or .auth properties. These errors originate from an authenticator as a standard AttributeError, however it's necessary that they be re-raised as a different exception type in order to prevent them from being suppressed by the outer property access. Python will not recognize that the AttributeError orginates from the authenticator and will instead assume that the request object does not have a .user or .auth property. The authenticator will need to be fixed.

+

Note: You may see a WrappedAttributeError raised when calling the .user or .auth properties. These errors originate from an authenticator as a standard AttributeError, however it's necessary that they be re-raised as a different exception type in order to prevent them from being suppressed by the outer property access. Python will not recognize that the AttributeError originates from the authenticator and will instead assume that the request object does not have a .user or .auth property. The authenticator will need to be fixed.


Browser enhancements

REST framework supports a few browser enhancements such as browser-based PUT, PATCH and DELETE forms.

diff --git a/api-guide/serializers/index.html b/api-guide/serializers/index.html index 8f6e7c01b..891c65d0c 100644 --- a/api-guide/serializers/index.html +++ b/api-guide/serializers/index.html @@ -1374,7 +1374,7 @@ def all_high_scores(request): into primitive representations. """ def to_representation(self, obj): - output = {} + output = {} for attribute_name in dir(obj): attribute = getattr(obj, attribute_name) if attribute_name.startswith('_'): @@ -1400,7 +1400,7 @@ def all_high_scores(request): else: # Force anything else to its string representation. output[attribute_name] = str(attribute) - return output + return output

Advanced serializer usage

diff --git a/community/release-notes/index.html b/community/release-notes/index.html index cf761a56a..4fe31d6f1 100644 --- a/community/release-notes/index.html +++ b/community/release-notes/index.html @@ -509,6 +509,18 @@

3.10.x series

+

3.10.2

+

Date: 29th July 2019

+ +

3.10.1

+

Date: 17th July 2019

+

3.10.0

Date: 15th July 2019