From 26b1bdf09be0d234e62ca65c3ac006d51e6dbc06 Mon Sep 17 00:00:00 2001
From: Tom Christie For clients to authenticate, the token key should be included in the Extends Django's existing The The The reason behind this is that Django's For most users this change shouldn't require any updates to your codebase, but it is worth ensuring that whenever raising validation errors you should prefer using the We strongly recommend that you use the namespaced import style of The This ensures you can still write validation that compares all the input fields, but that marks the error against a particular field. The under-used For example:?^n=0J`4qNa^Q$rs`2hA*O;2c6o^7f~}dPgUFbB5Lvr)Q)@+RYk>WI$uQP#4I(9
zFQTp|zA#<}1#$vqJ$<6j*G`z+P_^@`xAP^Xg4`5e{Bo!kQyJCLYD&<0+CneVcE*c<
z%Kfrom rest_framework.authtoken.models import Token
token = Token.objects.create(user=...)
-print token.key
+print(token.key)
Authorization
HTTP header. The key should be prefixed by the string literal "Token", with whitespace separating the two strings. For example:Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
diff --git a/api-guide/testing/index.html b/api-guide/testing/index.html
index 0f083d9ef..ea79a4dd2 100644
--- a/api-guide/testing/index.html
+++ b/api-guide/testing/index.html
@@ -626,7 +626,7 @@ response = view(request)
APIClient
Client
class.Making requests
-APIClient
class supports the same request interface as Django's standard Client
class. This means the that standard .get()
, .post()
, .put()
, .patch()
, .delete()
, .head()
and .options()
methods are all available. For example:APIClient
class supports the same request interface as Django's standard Client
class. This means that the standard .get()
, .post()
, .put()
, .patch()
, .delete()
, .head()
and .options()
methods are all available. For example:from rest_framework.test import APIClient
client = APIClient()
diff --git a/community/3.0-announcement/index.html b/community/3.0-announcement/index.html
index 1a5c6e136..6eb2acc70 100644
--- a/community/3.0-announcement/index.html
+++ b/community/3.0-announcement/index.html
@@ -579,7 +579,7 @@ def create(self, validated_data):
ValidationError
class is intended for use with HTML forms and its API makes using it slightly awkward with nested validation errors that can occur in serializers.serializers.ValidationError
exception class, and not Django's built-in exception.import serializers
and not from serializers import ValidationError
in order to avoid any potential confusion.Change to
+validate_<field_name>
.Change to
validate_<field_name>
.validate_<field_name>
method hooks that can be attached to serializer classes change their signature slightly and return type. Previously these would take a dictionary of all incoming data, and a key representing the field name, and would return a dictionary including the validated data for that field:def validate_score(self, attrs, source):
if attrs['score'] % 10 != 0:
@@ -605,7 +605,7 @@ def create(self, validated_data):
raise serializers.ValidationError({'my_field': 'A field error'})
Removal of
+transform_<field_name>
.Removal of
transform_<field_name>
.transform_<field_name>
on serializer classes is no longer provided. Instead you should just override to_representation()
if you need to apply any modifications to the representation style.def to_representation(self, instance):
diff --git a/community/3.9-announcement/index.html b/community/3.9-announcement/index.html
index c6705e1c8..1718d51ac 100644
--- a/community/3.9-announcement/index.html
+++ b/community/3.9-announcement/index.html
@@ -577,12 +577,12 @@ They will be removed entirely in 3.10.
exclude_from_schema
Both APIView.exclude_from_schema
and the exclude_from_schema
argument to the @api_view
have now been removed.
For APIView
you should instead set a schema = None
attribute on the view class.
For function based views the @schema
decorator can be used to exclude the view from the schema, by using @schema(None)
.
For function-based views the @schema
decorator can be used to exclude the view from the schema, by using @schema(None)
.
There are a large number of minor fixes and improvements in this release. See the release notes page for a complete listing.
We're planning to iteratively working towards OpenAPI becoming the standard schema +
We're planning to iteratively work towards OpenAPI becoming the standard schema
representation. This will mean that the coreapi
dependency will gradually become
removed, and we'll instead generate the schema directly, rather than building
a CoreAPI Document
object.
There will be further work on the Uvicorn -webserver, as well as lots of functionality planned for the Starlette +web server, as well as lots of functionality planned for the Starlette web framework, which is building a foundational set of tooling for working with ASGI.
diff --git a/community/release-notes/index.html b/community/release-notes/index.html index 8d89bd9a4..6cdae155d 100644 --- a/community/release-notes/index.html +++ b/community/release-notes/index.html @@ -506,7 +506,7 @@Date: 18st October 2018
+Date: 18th October 2018
action
support for ViewSet suffixes #6081None
.
SearchFilter
. (#3316)IPAddressField
. ([#3249gh3249) (#3250)IPAddressField
. ([#3249[gh3249]) (#3250)LimitOffsetPagination
when count=0, offset=0. (#3303){3Wtbi5IC
zgcd2*1Yi!q?)!FtpX^nK?>dEaHSLjqy|l7bz?pT{9em=p+|qGWb9oJ!LEk$QW(0~@
zXGAE4ZgNsCCNp!W37Z>4!7xYj1_oWVWN&5BO9cZbOC{CU*{wSkvoZ-_{
z{rk&%ds&21r*cy%VrxFv^=$vG5)lBK7|}voOFuW5vm4C;deR90)hgZR+`M!`K06uz
z)UBdEwaY$OV`8@JIoq@=@LamxHkS*8H=U#_2cMha1Z^*q*s6)x+1_;FsWKhIy$SD(C+=
zkv|nGFc}8Hlw(})xqzX9W!vycycg?
zPEBd*0+Qe-yp^tJcg+mrDpDlK7
w2NzKrb8v^@LQprpWCDs+6-pW
zbHisH?s!1(DmS5Cm-uUEu#ZHXBunl#8s$L<3}9i}5daY0{aFN^$GCefvUvu>C@J8j
zaBq%d6CWpZahZXWyLuA-xojqbXB9?ESQ_Sz_D|
FbtMp9C63I}H4XHsVIU;CQ^
z2KbMcw^J%U7ug99SU|`-nn6pLjCV4NQ|ysV5Rv)6r*mjq&faac#E2)U-YbIqR;wzVofS?ms%Vy}PTc
ztDoxKPwy(+AqxrK7$zKO{^KMHJS_ZqDh6H$1`ezeIqn=Wqvi%y2H3_?5bp`U!Lv93
zDi0eP0|fxj(+KW`@Zkp73V};JypH_0-#`Puhw@W=@M*#q1WzZVs-b40E=K=@V`_vG
z@Ax~OjNNi`%Ey0{8Bt
JEX<3@dam|lTS)B