diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 000000000..e69de29bb diff --git a/api-guide/authentication/index.html b/api-guide/authentication/index.html index 5d9309a06..bd8c108cd 100644 --- a/api-guide/authentication/index.html +++ b/api-guide/authentication/index.html @@ -617,6 +617,8 @@ urlpatterns += [
{ 'token' : '9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b' }
 

Note that the default obtain_auth_token view explicitly uses JSON requests and responses, rather than using default renderer and parser classes in your settings. If you need a customized version of the obtain_auth_token view, you can do so by overriding the ObtainAuthToken view class, and using that in your url conf instead.

+

By default there are no permissions or throttling applied to the obtain_auth_token view. If you do wish to apply throttling you'll need to override the view class, +and include them using the throttle_classes attribute.

With Django admin

It is also possible to create Tokens manually through admin interface. In case you are using a large user base, we recommend that you monkey patch the TokenAdmin class to customize it to your needs, more specifically by declaring the user field as raw_field.

your_app/admin.py:

@@ -685,7 +687,7 @@ REST_FRAMEWORK = { ) } -

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

+

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.

@@ -701,7 +703,7 @@ REST_FRAMEWORK = {

JSON Web Token Authentication

JSON Web Token is a fairly new standard which can be used for token-based authentication. Unlike the built-in TokenAuthentication scheme, JWT Authentication doesn't need to use a database to validate a token. Blimp maintains the djangorestframework-jwt package which provides a JWT Authentication class as well as a mechanism for clients to obtain a JWT given the username and password.

Hawk HTTP Authentication

-

The HawkREST library builds on the Mohawk library to let you work with Hawk signed requests and responses in your API. Hawk lets two parties securely communicate with each other using messages signed by a shared key. It is based on HTTP MAC access authentication (which was based on parts of OAuth 1.0).

+

The HawkREST library builds on the Mohawk library to let you work with Hawk signed requests and responses in your API. Hawk lets two parties securely communicate with each other using messages signed by a shared key. It is based on HTTP MAC access authentication (which was based on parts of OAuth 1.0).

HTTP Signature Authentication

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

diff --git a/api-guide/fields/index.html b/api-guide/fields/index.html index 161e3e39c..8a6188b2a 100644 --- a/api-guide/fields/index.html +++ b/api-guide/fields/index.html @@ -768,7 +768,7 @@ color_channel = serializers.ChoiceField(

Format strings may either be Python strftime formats which explicitly specify the format, or the special string 'iso-8601', which indicates that ISO 8601 style datetimes should be used. (eg '2013-01-29T12:34:56.000000Z')

When a value of None is used for the format datetime objects will be returned by to_representation and the final output representation will determined by the renderer class.

In the case of JSON this means the default datetime representation uses the ECMA 262 date time string specification. This is a subset of ISO 8601 which uses millisecond precision, and includes the 'Z' suffix for the UTC timezone, for example: 2013-01-29T12:34:56.123Z.

-

auto_now and auto_now_add model fields.

+

auto_now_add model fields.auto_now and

When using ModelSerializer or HyperlinkedModelSerializer, note that any model fields with auto_now=True or auto_now_add=True will use serializer fields that are read_only=True by default.

If you want to override this behavior, you'll need to declare the DateTimeField explicitly on the serializer. For example:

class CommentSerializer(serializers.ModelSerializer):
@@ -1022,7 +1022,7 @@ def to_internal_value(self, data):
 

Third party packages

The following third party packages are also available.

DRF Compound Fields

-

The drf-compound-fields package provides "compound" serializer fields, such as lists of simple values, which can be described by other fields rather than serializers with the many=True option. Also provided are fields for typed dictionaries and values that can be either a specific type or a list of items of that type.

+

The drf-compound-fields package provides "compound" serializer fields, such as lists of simple values, which can be described by other fields rather than serializers with the many=True option. Also provided are fields for typed dictionaries and values that can be either a specific type or a list of items of that type.

DRF Extra Fields

The drf-extra-fields package provides extra serializer fields for REST framework, including Base64ImageField and PointField classes.

djangrestframework-recursive

diff --git a/api-guide/filtering/index.html b/api-guide/filtering/index.html index 3833e1147..4bea39168 100644 --- a/api-guide/filtering/index.html +++ b/api-guide/filtering/index.html @@ -536,7 +536,7 @@ from rest_framework import generics class UserListView(generics.ListAPIView): queryset = User.objects.all() - serializer = UserSerializer + serializer_class = UserSerializer filter_backends = (filters.DjangoFilterBackend,)

Filtering and object lookups

@@ -639,7 +639,7 @@ class ProductFilter(filters.FilterSet):

And now you can execute:

http://example.com/api/products?manufacturer=foo
 
-

For more details on using filter sets see the django-filter documentation.

+

For more details on using filter sets see the django-filter documentation.


Hints & Tips

Videos