From e628d9eb9b7deac2ecffe23eace5c72709887f8f Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 6 Mar 2015 12:05:16 +0000 Subject: [PATCH] Update documentation --- .DS_Store | Bin 0 -> 15364 bytes api-guide/authentication/index.html | 151 ++-- api-guide/content-negotiation/index.html | 34 +- api-guide/exceptions/index.html | 55 +- api-guide/fields/index.html | 35 +- api-guide/filtering/index.html | 32 +- api-guide/format-suffixes/index.html | 32 +- api-guide/generic-views/index.html | 38 +- api-guide/metadata/index.html | 32 +- api-guide/pagination/index.html | 405 +++++++---- api-guide/parsers/index.html | 106 +-- api-guide/permissions/index.html | 46 +- api-guide/relations/index.html | 32 +- api-guide/renderers/index.html | 160 ++-- api-guide/requests/index.html | 34 +- api-guide/responses/index.html | 32 +- api-guide/reverse/index.html | 32 +- api-guide/routers/index.html | 32 +- api-guide/serializers/index.html | 85 ++- api-guide/settings/index.html | 53 +- api-guide/status-codes/index.html | 32 +- api-guide/testing/index.html | 46 +- api-guide/throttling/index.html | 32 +- api-guide/validators/index.html | 32 +- api-guide/versioning/index.html | 612 ++++++++++++++++ api-guide/views/index.html | 32 +- api-guide/viewsets/index.html | 34 +- css/default.css | 23 + img/.DS_Store | Bin 0 -> 15364 bytes img/cursor-pagination.png | Bin 0 -> 12221 bytes img/link-header-pagination.png | Bin 0 -> 35799 bytes img/pages-pagination.png | Bin 0 -> 10229 bytes img/sponsors/.DS_Store | Bin 0 -> 15364 bytes index.html | 48 +- topics/2.2-announcement/index.html | 546 -------------- topics/2.3-announcement/index.html | 683 ------------------ topics/3.0-announcement/index.html | 36 +- .../index.html | 303 ++++---- topics/ajax-csrf-cors/index.html | 34 +- topics/browsable-api/index.html | 32 +- topics/browser-enhancements/index.html | 32 +- topics/contributing/index.html | 32 +- topics/credits/index.html | 626 ---------------- topics/documenting-your-api/index.html | 34 +- .../index.html | 202 +++--- topics/kickstarter-announcement/index.html | 34 +- topics/project-management/index.html | 87 ++- topics/release-notes/index.html | 561 +------------- topics/rest-hypermedia-hateoas/index.html | 32 +- topics/third-party-resources/index.html | 33 +- tutorial/1-serialization/index.html | 32 +- tutorial/2-requests-and-responses/index.html | 34 +- tutorial/3-class-based-views/index.html | 32 +- .../index.html | 32 +- .../index.html | 34 +- tutorial/6-viewsets-and-routers/index.html | 32 +- tutorial/quickstart/index.html | 34 +- 57 files changed, 2013 insertions(+), 3841 deletions(-) create mode 100644 .DS_Store create mode 100644 api-guide/versioning/index.html create mode 100644 img/.DS_Store create mode 100644 img/cursor-pagination.png create mode 100644 img/link-header-pagination.png create mode 100644 img/pages-pagination.png create mode 100644 img/sponsors/.DS_Store delete mode 100644 topics/2.2-announcement/index.html delete mode 100644 topics/2.3-announcement/index.html rename topics/{2.4-announcement => 3.1-announcement}/index.html (53%) delete mode 100644 topics/credits/index.html rename topics/{rest-framework-2-announcement => internationalization}/index.html (62%) diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..1ea84ba6c8398d3ff323abc754aec83eb6954986 GIT binary patch literal 15364 zcmeHMUu+ab7@uETU{CgB`43gXQ|Iy)PKxx z&JYizcnbss0#gy-XZKQOupu^(9-er9Hx1XTsrdmVrDZc_&XOV#N$%}5EX^KH*f~pc zdy<3paMIB9wCe2f^PcME+=S}*nhw<)B#oa>*|tgf-mrD2p?QOS%Holc`VG~w+PeDD z>exvA+I7{jx^*?9qY+7pC`?+o;-1ahQtHUz(Z?PS+(x+cS#(kuN5*3?GWqZh0+-U+ zAckKQr5MF+v*qaRbCkLB<}X;dXz`Mz<#*gUui~y)pE5tKX7&v@JhUd;w4H>R)BBV; zE(O_|v8@hA&l~!1m!}`_lExuY&6{MfQ`h#6SEUYSsm+4%3cu49N7t>M0msnV`}*6D19NRQIY}fD%+v=X6?e6tQ_w=DwtKX&(xd-i8-pqYicU+QF?7Q}uYFanjt%U7) z_E5L#II1ND7LTk(8wl z>6P)0u&4O;&`x5jStCobUbdf&v19BFc9NZDXV^t{8KsC~5msO|s!@k6h@%xd(E|-S z29U*m|UTqAAj z{v^yrbtK|jEiI4Ay&8?T!`8T+rks=lO+|S$+QT(Xj!th)l6->|l~Fn6Qp}1PHe6LD z%c*^|^c6Skw0eyk-Q^Qa(ISCa?OHk7nGaa0Y!55fFO;KQ8GC4moOZ*yjhmv;y?od< z)%Du5xEi0>KtyyTE>Bzq2dsFZMV42MiJ7;1VoFIVy24YEX-fXh0(pXhItvLJ}$L z!d_x!Ke2LIbHyjxvj{2gz?u^o}Z$&p2+ps)~vwv?c;=^_r-xl={r)T25+Z zhR<2HavBAFCrh=ULU0fB%(Kp-FxxMdM24LpzW`~R)e|Nno>#wQ#X2nYnO zj{wS=lg$ZgSGZuAY{Ku_WAr>i4^O<^SRj29dR_HL02TOkynm%cy6{TFw~JFfw;v0n zZ%$?3oMdpDf5ZO_5a<61SB^LA21}g(Z{qVmUw40{sp*;GGqV% literal 0 HcmV?d00001 diff --git a/api-guide/authentication/index.html b/api-guide/authentication/index.html index 7a523c630..bf3048977 100644 --- a/api-guide/authentication/index.html +++ b/api-guide/authentication/index.html @@ -188,6 +188,10 @@ Pagination +
  • + Versioning +
  • +
  • Content negotiation
  • @@ -231,6 +235,10 @@ Documenting your API +
  • + Internationalization +
  • +
  • AJAX, CSRF & CORS
  • @@ -259,26 +267,14 @@ Project management -
  • - 2.0 Announcement -
  • - -
  • - 2.2 Announcement -
  • - -
  • - 2.3 Announcement -
  • - -
  • - 2.4 Announcement -
  • -
  • 3.0 Announcement
  • +
  • + 3.1 Announcement +
  • +
  • Kickstarter Announcement
  • @@ -287,10 +283,6 @@ Release Notes -
  • - Credits -
  • - @@ -393,14 +385,6 @@ SessionAuthentication -
  • - OAuthAuthentication -
  • - -
  • - OAuth2Authentication -
  • - @@ -422,11 +406,15 @@
  • - Digest Authentication + Django OAuth Toolkit
  • - Django OAuth Toolkit + Django REST framework OAuth +
  • + +
  • + Digest Authentication
  • @@ -449,6 +437,10 @@ Djoser
  • +
  • + django-rest-auth +
  • + @@ -649,74 +641,6 @@ python manage.py createsuperuser

    Unauthenticated responses that are denied permission will result in an HTTP 403 Forbidden response.

    If you're using an AJAX style API with SessionAuthentication, you'll need to make sure you include a valid CSRF token for any "unsafe" HTTP method calls, such as PUT, PATCH, POST or DELETE requests. See the Django CSRF documentation for more details.

    -

    OAuthAuthentication

    -

    This authentication uses OAuth 1.0a authentication scheme. OAuth 1.0a provides signature validation which provides a reasonable level of security over plain non-HTTPS connections. However, it may also be considered more complicated than OAuth2, as it requires clients to sign their requests.

    -

    This authentication class depends on the optional django-oauth-plus and oauth2 packages. In order to make it work you must install these packages and add oauth_provider to your INSTALLED_APPS:

    -
    INSTALLED_APPS = (
    -    ...
    -    `oauth_provider`,
    -)
    -
    -

    Don't forget to run syncdb once you've added the package.

    -
    python manage.py syncdb
    -
    -

    Getting started with django-oauth-plus

    -

    The OAuthAuthentication class only provides token verification and signature validation for requests. It doesn't provide authorization flow for your clients. You still need to implement your own views for accessing and authorizing tokens.

    -

    The django-oauth-plus package provides simple foundation for classic 'three-legged' oauth flow. Please refer to the documentation for more details.

    -

    OAuth2Authentication

    -

    This authentication uses OAuth 2.0 authentication scheme. OAuth2 is more simple to work with than OAuth1, and provides much better security than simple token authentication. It is an unauthenticated scheme, and requires you to use an HTTPS connection.

    -

    This authentication class depends on the optional django-oauth2-provider project. In order to make it work you must install this package and add provider and provider.oauth2 to your INSTALLED_APPS:

    -
    INSTALLED_APPS = (
    -    ...
    -    'provider',
    -    'provider.oauth2',
    -)
    -
    -

    Then add OAuth2Authentication to your global DEFAULT_AUTHENTICATION_CLASSES setting:

    -
    'DEFAULT_AUTHENTICATION_CLASSES': (
    -    'rest_framework.authentication.OAuth2Authentication',
    -),
    -
    -

    You must also include the following in your root urls.py module:

    -
    url(r'^oauth2/', include('provider.oauth2.urls', namespace='oauth2')),
    -
    -

    Note that the namespace='oauth2' argument is required.

    -

    Finally, sync your database.

    -
    python manage.py syncdb
    -python manage.py migrate
    -
    -
    -

    Note: If you use OAuth2Authentication in production you must ensure that your API is only available over https.

    -
    -

    Getting started with django-oauth2-provider

    -

    The OAuth2Authentication class only provides token verification for requests. It doesn't provide authorization flow for your clients.

    -

    The OAuth 2 authorization flow is taken care by the django-oauth2-provider dependency. A walkthrough is given here, but for more details you should refer to the documentation.

    -

    To get started:

    -
    1. Create a client
    -

    You can create a client, either through the shell, or by using the Django admin.

    -

    Go to the admin panel and create a new Provider.Client entry. It will create the client_id and client_secret properties for you.

    -
    2. Request an access token
    -

    To request an access token, submit a POST request to the url /oauth2/access_token with the following fields:

    -
      -
    • client_id the client id you've just configured at the previous step.
    • -
    • client_secret again configured at the previous step.
    • -
    • username the username with which you want to log in.
    • -
    • password well, that speaks for itself.
    • -
    -

    You can use the command line to test that your local configuration is working:

    -
    curl -X POST -d "client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET&grant_type=password&username=YOUR_USERNAME&password=YOUR_PASSWORD" http://localhost:8000/oauth2/access_token/
    -
    -

    You should get a response that looks something like this:

    -
    {"access_token": "<your-access-token>", "scope": "read", "expires_in": 86399, "refresh_token": "<your-refresh-token>"}
    -
    -
    3. Access the API
    -

    The only thing needed to make the OAuth2Authentication class work is to insert the access_token you've received in the Authorization request header.

    -

    The command line to test the authentication looks like:

    -
    curl -H "Authorization: Bearer <your-access-token>" http://localhost:8000/api/
    -
    -

    Alternative OAuth 2 implementations

    -

    Note that Django OAuth Toolkit is an alternative external package that also includes OAuth 2.0 support for REST framework.

    -

    Custom authentication

    To implement a custom authentication scheme, subclass BaseAuthentication and override the .authenticate(self, request) method. The method should return a two-tuple of (user, auth) if authentication succeeds, or None otherwise.

    In some circumstances instead of returning None, you may want to raise an AuthenticationFailed exception from the .authenticate() method.

    @@ -749,10 +673,35 @@ class ExampleAuthentication(authentication.BaseAuthentication):

    Third party packages

    The following third party packages are also available.

    +

    Django OAuth Toolkit

    +

    The Django OAuth Toolkit package provides OAuth 2.0 support, and works with Python 2.7 and Python 3.3+. The package is maintained by Evonove and uses the excellent OAuthLib. The package is well documented, and well supported and is currently our recommended package for OAuth 2.0 support.

    +

    Installation & configuration

    +

    Install using pip.

    +
    pip install django-oauth-toolkit
    +
    +

    Add the package to your INSTALLED_APPS and modify your REST framework settings.

    +
    INSTALLED_APPS = (
    +    ...
    +    'oauth2_provider',
    +)
    +
    +REST_FRAMEWORK = {
    +    'DEFAULT_AUTHENTICATION_CLASSES': (
    +        'oauth2_provider.ext.rest_framework.OAuth2Authentication',
    +    )
    +}
    +
    +

    For more details see the Django REST framework - Getting started documentation.

    +

    Django REST framework OAuth

    +

    The Django REST framework OAuth package provides both OAuth1 and OAuth2 support for REST framework.

    +

    This package was previously included directly in REST framework but is now supported and maintained as a third party package.

    +

    Installation & configuration

    +

    Install the package using pip.

    +
    pip install djangorestframework-oauth
    +
    +

    For details on configuration and usage see the Django REST framework OAuth documentation for authentication and permissions.

    Digest Authentication

    HTTP digest authentication is a widely implemented scheme that was intended to replace HTTP basic authentication, and which provides a simple encrypted authentication mechanism. Juan Riaza maintains the djangorestframework-digestauth package which provides HTTP digest authentication support for REST framework.

    -

    Django OAuth Toolkit

    -

    The Django OAuth Toolkit package provides OAuth 2.0 support, and works with Python 2.7 and Python 3.3+. The package is maintained by Evonove and uses the excellent OAuthLib. The package is well documented, and comes as a recommended alternative for OAuth 2.0 support.

    Django OAuth2 Consumer

    The Django OAuth2 Consumer library from Rediker Software is another package that provides OAuth 2.0 support for REST framework. The package includes token scoping permissions on tokens, which allows finer-grained access to your API.

    JSON Web Token Authentication

    @@ -763,6 +712,8 @@ class ExampleAuthentication(authentication.BaseAuthentication):

    HTTP Signature (currently a IETF draft) provides a way to achieve origin authentication and message integrity for HTTP messages. Similar to Amazon's HTTP Signature scheme, used by many of its services, it permits stateless, per-request authentication. Elvio Toccalino maintains the djangorestframework-httpsignature package which provides an easy to use HTTP Signature Authentication mechanism.

    Djoser

    Djoser library provides a set of views to handle basic actions such as registration, login, logout, password reset and account activation. The package works with a custom user model and it uses token based authentication. This is a ready to use REST implementation of Django authentication system.

    +

    django-rest-auth

    +

    Django-rest-auth library provides a set of REST API endpoints for registration, authentication (including social media authentication), password reset, retrieve and update user details, etc. By having these API endpoints, your client apps such as AngularJS, iOS, Android, and others can communicate to your Django backend site independently via REST APIs for user management.

    diff --git a/api-guide/content-negotiation/index.html b/api-guide/content-negotiation/index.html index fcc0ff3a0..ebde1d6b9 100644 --- a/api-guide/content-negotiation/index.html +++ b/api-guide/content-negotiation/index.html @@ -65,7 +65,7 @@ - Search @@ -188,6 +188,10 @@ Pagination +
  • + Versioning +
  • +
  • Content negotiation
  • @@ -231,6 +235,10 @@ Documenting your API +
  • + Internationalization +
  • +
  • AJAX, CSRF & CORS
  • @@ -259,26 +267,14 @@ Project management -
  • - 2.0 Announcement -
  • - -
  • - 2.2 Announcement -
  • - -
  • - 2.3 Announcement -
  • - -
  • - 2.4 Announcement -
  • -
  • 3.0 Announcement
  • +
  • + 3.1 Announcement +
  • +
  • Kickstarter Announcement
  • @@ -287,10 +283,6 @@ Release Notes -
  • - Credits -
  • - diff --git a/api-guide/exceptions/index.html b/api-guide/exceptions/index.html index f9403f1d0..c0ddeb4fe 100644 --- a/api-guide/exceptions/index.html +++ b/api-guide/exceptions/index.html @@ -188,6 +188,10 @@ Pagination +
  • + Versioning +
  • +
  • Content negotiation
  • @@ -231,6 +235,10 @@ Documenting your API +
  • + Internationalization +
  • +
  • AJAX, CSRF & CORS
  • @@ -259,26 +267,14 @@ Project management -
  • - 2.0 Announcement -
  • - -
  • - 2.2 Announcement -
  • - -
  • - 2.3 Announcement -
  • - -
  • - 2.4 Announcement -
  • -
  • 3.0 Announcement
  • +
  • + 3.1 Announcement +
  • +
  • Kickstarter Announcement
  • @@ -287,10 +283,6 @@ Release Notes -
  • - Credits -
  • - @@ -393,10 +385,18 @@ PermissionDenied +
  • + NotFound +
  • +
  • MethodNotAllowed
  • +
  • + NotAcceptable +
  • +
  • UnsupportedMediaType
  • @@ -464,7 +464,7 @@ Content-Length: 94

    Custom exception handling

    You can implement custom exception handling by creating a handler function that converts exceptions raised in your API views into response objects. This allows you to control the style of error responses used by your API.

    -

    The function must take a single argument, which is the exception to be handled, and should either return a Response object, or return None if the exception cannot be handled. If the handler returns None then the exception will be re-raised and Django will return a standard HTTP 500 'server error' response.

    +

    The function must take a pair of arguments, this first is the exception to be handled, and the second is a dictionary containing any extra context such as the view currently being handled. The exception handler function should either return a Response object, or return None if the exception cannot be handled. If the handler returns None then the exception will be re-raised and Django will return a standard HTTP 500 'server error' response.

    For example, you might want to ensure that all error responses include the HTTP status code in the body of the response, like so:

    HTTP/1.1 405 Method Not Allowed
     Content-Type: application/json
    @@ -475,10 +475,10 @@ Content-Length: 62
     

    In order to alter the style of the response, you could write the following custom exception handler:

    from rest_framework.views import exception_handler
     
    -def custom_exception_handler(exc):
    +def custom_exception_handler(exc, context):
         # Call REST framework's default exception handler first,
         # to get the standard error response.
    -    response = exception_handler(exc)
    +    response = exception_handler(exc, context)
     
         # Now add the HTTP status code to the response.
         if response is not None:
    @@ -486,6 +486,7 @@ def custom_exception_handler(exc):
     
         return response
     
    +

    The context argument is not used by the default handler, but can be useful if the exception handler needs further information such as the view currently being handled, which can be accessed as context['view'].

    The exception handler must also be configured in your settings, using the EXCEPTION_HANDLER setting key. For example:

    REST_FRAMEWORK = {
         'EXCEPTION_HANDLER': 'my_project.my_app.utils.custom_exception_handler'
    @@ -526,10 +527,18 @@ class ServiceUnavailable(APIException):
     

    Signature: PermissionDenied(detail=None)

    Raised when an authenticated request fails the permission checks.

    By default this exception results in a response with the HTTP status code "403 Forbidden".

    +

    NotFound

    +

    Signature: NotFound(detail=None)

    +

    Raised when a resource does not exists at the given URL. This exception is equivalent to the standard Http404 Django exception.

    +

    By default this exception results in a response with the HTTP status code "404 Not Found".

    MethodNotAllowed

    Signature: MethodNotAllowed(method, detail=None)

    Raised when an incoming request occurs that does not map to a handler method on the view.

    By default this exception results in a response with the HTTP status code "405 Method Not Allowed".

    +

    NotAcceptable

    +

    Signature: NotAcceptable(detail=None)

    +

    Raised when an incoming request occurs with an Accept header that cannot be satisfied by any of the available renderers.

    +

    By default this exception results in a response with the HTTP status code "406 Not Acceptable".

    UnsupportedMediaType

    Signature: UnsupportedMediaType(media_type, detail=None)

    Raised if there are no parsers that can handle the content type of the request data when accessing request.data.

    diff --git a/api-guide/fields/index.html b/api-guide/fields/index.html index 9fd73553f..1b7019fe0 100644 --- a/api-guide/fields/index.html +++ b/api-guide/fields/index.html @@ -188,6 +188,10 @@ Pagination +
  • + Versioning +
  • +
  • Content negotiation
  • @@ -231,6 +235,10 @@ Documenting your API +
  • + Internationalization +
  • +
  • AJAX, CSRF & CORS
  • @@ -259,26 +267,14 @@ Project management -
  • - 2.0 Announcement -
  • - -
  • - 2.2 Announcement -
  • - -
  • - 2.3 Announcement -
  • - -
  • - 2.4 Announcement -
  • -
  • 3.0 Announcement
  • +
  • + 3.1 Announcement +
  • +
  • Kickstarter Announcement
  • @@ -287,10 +283,6 @@ Release Notes -
  • - Credits -
  • - @@ -661,11 +653,12 @@ color_channel = serializers.ChoiceField(

    CharField

    A text representation. Optionally validates the text to be shorter than max_length and longer than min_length.

    Corresponds to django.db.models.fields.CharField or django.db.models.fields.TextField.

    -

    Signature: CharField(max_length=None, min_length=None, allow_blank=False)

    +

    Signature: CharField(max_length=None, min_length=None, allow_blank=False, trim_whitespace=True)

    • max_length - Validates that the input contains no more than this number of characters.
    • min_length - Validates that the input contains no fewer than this number of characters.
    • allow_blank - If set to True then the empty string should be considered a valid value. If set to False then the empty string is considered invalid and will raise a validation error. Defaults to False.
    • +
    • trim_whitespace - If set to True then leading and trailing whitespace is trimmed. Defaults to True.

    The allow_null option is also available for string fields, although its usage is discouraged in favor of allow_blank. It is valid to set both allow_blank=True and allow_null=True, but doing so means that there will be two differing types of empty value permissible for string representations, which can lead to data inconsistencies and subtle application bugs.

    EmailField

    diff --git a/api-guide/filtering/index.html b/api-guide/filtering/index.html index 7cf57f6b6..fc8dafb20 100644 --- a/api-guide/filtering/index.html +++ b/api-guide/filtering/index.html @@ -188,6 +188,10 @@ Pagination +
  • + Versioning +
  • +
  • Content negotiation
  • @@ -231,6 +235,10 @@ Documenting your API +
  • + Internationalization +
  • +
  • AJAX, CSRF & CORS
  • @@ -259,26 +267,14 @@ Project management -
  • - 2.0 Announcement -
  • - -
  • - 2.2 Announcement -
  • - -
  • - 2.3 Announcement -
  • - -
  • - 2.4 Announcement -
  • -
  • 3.0 Announcement
  • +
  • + 3.1 Announcement +
  • +
  • Kickstarter Announcement
  • @@ -287,10 +283,6 @@ Release Notes -
  • - Credits -
  • - diff --git a/api-guide/format-suffixes/index.html b/api-guide/format-suffixes/index.html index d7d74db91..a01438d83 100644 --- a/api-guide/format-suffixes/index.html +++ b/api-guide/format-suffixes/index.html @@ -188,6 +188,10 @@ Pagination +
  • + Versioning +
  • +
  • Content negotiation
  • @@ -231,6 +235,10 @@ Documenting your API +
  • + Internationalization +
  • +
  • AJAX, CSRF & CORS
  • @@ -259,26 +267,14 @@ Project management -
  • - 2.0 Announcement -
  • - -
  • - 2.2 Announcement -
  • - -
  • - 2.3 Announcement -
  • - -
  • - 2.4 Announcement -
  • -
  • 3.0 Announcement
  • +
  • + 3.1 Announcement +
  • +
  • Kickstarter Announcement
  • @@ -287,10 +283,6 @@ Release Notes -
  • - Credits -
  • - diff --git a/api-guide/generic-views/index.html b/api-guide/generic-views/index.html index 082f0bb09..288a71158 100644 --- a/api-guide/generic-views/index.html +++ b/api-guide/generic-views/index.html @@ -188,6 +188,10 @@ Pagination +
  • + Versioning +
  • +
  • Content negotiation
  • @@ -231,6 +235,10 @@ Documenting your API +
  • + Internationalization +
  • +
  • AJAX, CSRF & CORS
  • @@ -259,26 +267,14 @@ Project management -
  • - 2.0 Announcement -
  • - -
  • - 2.2 Announcement -
  • - -
  • - 2.3 Announcement -
  • - -
  • - 2.4 Announcement -
  • -
  • 3.0 Announcement
  • +
  • + 3.1 Announcement +
  • +
  • Kickstarter Announcement
  • @@ -287,10 +283,6 @@ Release Notes -
  • - Credits -
  • - @@ -568,11 +560,9 @@ class UserList(generics.ListCreateAPIView):

    Pagination:

    The following attributes are used to control pagination when used with list views.

      -
    • paginate_by - The size of pages to use with paginated data. If set to None then pagination is turned off. If unset this uses the same value as the PAGINATE_BY setting, which defaults to None.
    • -
    • paginate_by_param - The name of a query parameter, which can be used by the client to override the default page size to use for pagination. If unset this uses the same value as the PAGINATE_BY_PARAM setting, which defaults to None.
    • -
    • pagination_serializer_class - The pagination serializer class to use when determining the style of paginated responses. Defaults to the same value as the DEFAULT_PAGINATION_SERIALIZER_CLASS setting.
    • -
    • page_kwarg - The name of a URL kwarg or URL query parameter which can be used by the client to control which page is requested. Defaults to 'page'.
    • +
    • pagination_class - The pagination class that should be used when paginating list results. Defaults to the same value as the DEFAULT_PAGINATION_CLASS setting, which is 'rest_framework.pagination.PageNumberPagination'.
    +

    Note that usage of the paginate_by, paginate_by_param and page_kwarg attributes are now pending deprecation. The pagination_serializer_class attribute and DEFAULT_PAGINATION_SERIALIZER_CLASS setting have been removed completely. Pagination settings should instead be controlled by overriding a pagination class and setting any configuration attributes there. See the pagination documentation for more details.

    Filtering:

    diff --git a/api-guide/pagination/index.html b/api-guide/pagination/index.html index 5e8f2a82f..37cb383ed 100644 --- a/api-guide/pagination/index.html +++ b/api-guide/pagination/index.html @@ -62,7 +62,7 @@