From 97a47958c0f883f19abef0181df83fcb8cb18d5a Mon Sep 17 00:00:00 2001 From: Anuvrat Parashar Date: Mon, 24 Dec 2018 21:24:27 +0530 Subject: [PATCH 1/4] correct grammar, remove common noun after proper noun. (#6383) `MultipartParser` is enough to denote that it is a parser. --- docs/api-guide/parsers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-guide/parsers.md b/docs/api-guide/parsers.md index 09ce4556f..be48ae7e5 100644 --- a/docs/api-guide/parsers.md +++ b/docs/api-guide/parsers.md @@ -102,7 +102,7 @@ If it is called without a `filename` URL keyword argument, then the client must ##### Notes: -* The `FileUploadParser` is for usage with native clients that can upload the file as a raw data request. For web-based uploads, or for native clients with multipart upload support, you should use the `MultiPartParser` parser instead. +* The `FileUploadParser` is for usage with native clients that can upload the file as a raw data request. For web-based uploads, or for native clients with multipart upload support, you should use the `MultiPartParser` instead. * Since this parser's `media_type` matches any content type, `FileUploadParser` should generally be the only parser set on an API view. * `FileUploadParser` respects Django's standard `FILE_UPLOAD_HANDLERS` setting, and the `request.upload_handlers` attribute. See the [Django documentation][upload-handlers] for more details. From 1a9548db4ff102fea43c72f1bc1156336f5dba71 Mon Sep 17 00:00:00 2001 From: Phil Ratcliffe Date: Fri, 28 Dec 2018 16:10:08 +0000 Subject: [PATCH 2/4] Fix missing import in example code --- docs/api-guide/permissions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-guide/permissions.md b/docs/api-guide/permissions.md index 238e996c4..a11ad7d2b 100644 --- a/docs/api-guide/permissions.md +++ b/docs/api-guide/permissions.md @@ -104,7 +104,7 @@ __Note:__ when you set new permission classes through class attribute or decorat Provided they inherit from `rest_framework.permissions.BasePermission`, permissions can be composed using standard Python bitwise operators. For example, `IsAuthenticatedOrReadOnly` could be written: - from rest_framework.permissions import BasePermission, IsAuthenticated + from rest_framework.permissions import BasePermission, IsAuthenticated, SAFE_METHODS from rest_framework.response import Response from rest_framework.views import APIView From 1e2fd25f545dba90872498d748eaec920268d33b Mon Sep 17 00:00:00 2001 From: Adrien Brunet Date: Fri, 4 Jan 2019 15:45:08 +0100 Subject: [PATCH 3/4] Fix #3387: Documentation - Remove leading '.' before format option (#6388) --- docs/api-guide/renderers.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/api-guide/renderers.md b/docs/api-guide/renderers.md index a43f4be8a..4ec409681 100644 --- a/docs/api-guide/renderers.md +++ b/docs/api-guide/renderers.md @@ -89,7 +89,7 @@ The default JSON encoding style can be altered using the `UNICODE_JSON` and `COM **.media_type**: `application/json` -**.format**: `'.json'` +**.format**: `'json'` **.charset**: `None` @@ -127,7 +127,7 @@ See the [_HTML & Forms_ Topic Page][html-and-forms] for further examples of `Tem **.media_type**: `text/html` -**.format**: `'.html'` +**.format**: `'html'` **.charset**: `utf-8` @@ -149,7 +149,7 @@ You can use `StaticHTMLRenderer` either to return regular HTML pages using REST **.media_type**: `text/html` -**.format**: `'.html'` +**.format**: `'html'` **.charset**: `utf-8` @@ -165,7 +165,7 @@ This renderer will determine which other renderer would have been given highest **.media_type**: `text/html` -**.format**: `'.api'` +**.format**: `'api'` **.charset**: `utf-8` @@ -200,7 +200,7 @@ Note that views that have nested or list serializers for their input won't work **.media_type**: `text/html` -**.format**: `'.admin'` +**.format**: `'admin'` **.charset**: `utf-8` @@ -224,7 +224,7 @@ For more information see the [HTML & Forms][html-and-forms] documentation. **.media_type**: `text/html` -**.format**: `'.form'` +**.format**: `'form'` **.charset**: `utf-8` @@ -236,7 +236,7 @@ This renderer is used for rendering HTML multipart form data. **It is not suita **.media_type**: `multipart/form-data; boundary=BoUnDaRyStRiNg` -**.format**: `'.multipart'` +**.format**: `'multipart'` **.charset**: `utf-8` From 7749e4e3bed56e0f3e7775b0b1158d300964f6c0 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Fri, 4 Jan 2019 21:00:38 -0500 Subject: [PATCH 4/4] Make code snippet Python 3 compatible (#6377) --- docs/tutorial/4-authentication-and-permissions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/tutorial/4-authentication-and-permissions.md b/docs/tutorial/4-authentication-and-permissions.md index ef5b45c90..d616b6539 100644 --- a/docs/tutorial/4-authentication-and-permissions.md +++ b/docs/tutorial/4-authentication-and-permissions.md @@ -197,7 +197,7 @@ If we're interacting with the API programmatically we need to explicitly provide If we try to create a snippet without authenticating, we'll get an error: - http POST http://127.0.0.1:8000/snippets/ code="print 123" + http POST http://127.0.0.1:8000/snippets/ code="print(123)" { "detail": "Authentication credentials were not provided." @@ -205,13 +205,13 @@ If we try to create a snippet without authenticating, we'll get an error: We can make a successful request by including the username and password of one of the users we created earlier. - http -a admin:password123 POST http://127.0.0.1:8000/snippets/ code="print 789" + http -a admin:password123 POST http://127.0.0.1:8000/snippets/ code="print(789)" { "id": 1, "owner": "admin", "title": "foo", - "code": "print 789", + "code": "print(789)", "linenos": false, "language": "python", "style": "friendly"