diff options
Diffstat (limited to 'tutorial/1-serialization.html')
| -rw-r--r-- | tutorial/1-serialization.html | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tutorial/1-serialization.html b/tutorial/1-serialization.html index fba132f1..53401303 100644 --- a/tutorial/1-serialization.html +++ b/tutorial/1-serialization.html @@ -356,7 +356,7 @@ serializer.data content # '{"pk": 2, "title": "", "code": "print \\"hello, world\\"\\n", "linenos": false, "language": "python", "style": "friendly"}' </code></pre> -<p>Deserialization is similar. First we parse a stream into Python native datatypes... </p> +<p>Deserialization is similar. First we parse a stream into Python native datatypes...</p> <pre class="prettyprint lang-py"><code># This import will use either `StringIO.StringIO` or `io.BytesIO` # as appropriate, depending on if we're running Python 2 or Python 3. from rest_framework.compat import BytesIO @@ -427,7 +427,7 @@ def snippet_list(request): return JSONResponse(serializer.data, status=201) return JSONResponse(serializer.errors, status=400) </code></pre> -<p>Note that because we want to be able to POST to this view from clients that won't have a CSRF token we need to mark the view as <code>csrf_exempt</code>. This isn't something that you'd normally want to do, and REST framework views actually use more sensible behavior than this, but it'll do for our purposes right now. </p> +<p>Note that because we want to be able to POST to this view from clients that won't have a CSRF token we need to mark the view as <code>csrf_exempt</code>. This isn't something that you'd normally want to do, and REST framework views actually use more sensible behavior than this, but it'll do for our purposes right now.</p> <p>We'll also need a view which corresponds to an individual snippet, and can be used to retrieve, update or delete the snippet.</p> <pre class="prettyprint lang-py"><code>@csrf_exempt def snippet_detail(request, pk): |
