From 760da25c6018eff02b3aab33dc6fea7c93881d9f Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 17 Dec 2014 16:23:42 +0000 Subject: Update documentation --- tutorial/1-serialization/index.html | 4 ++-- tutorial/2-requests-and-responses/index.html | 2 +- tutorial/quickstart/index.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tutorial') diff --git a/tutorial/1-serialization/index.html b/tutorial/1-serialization/index.html index 435d47e6..5682989c 100644 --- a/tutorial/1-serialization/index.html +++ b/tutorial/1-serialization/index.html @@ -535,7 +535,7 @@ content

Deserialization is similar. First we parse a stream into Python native datatypes...

# 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
+from django.utils.six import BytesIO
 
 stream = BytesIO(content)
 data = JSONParser().parse(stream)
@@ -565,7 +565,7 @@ Open the file snippets/serializers.py again, and edit the Sni
         model = Snippet
         fields = ('id', 'title', 'code', 'linenos', 'language', 'style')
 
-

One nice property that serializers have is that you can inspect all the fields in a serializer instance, by printing it's representation. Open the Django shell with python manange.py shell, then try the following:

+

One nice property that serializers have is that you can inspect all the fields in a serializer instance, by printing it's representation. Open the Django shell with python manage.py shell, then try the following:

>>> from snippets.serializers import SnippetSerializer
 >>> serializer = SnippetSerializer()
 >>> print(repr(serializer))
diff --git a/tutorial/2-requests-and-responses/index.html b/tutorial/2-requests-and-responses/index.html
index 9fa4b092..e9436d2a 100644
--- a/tutorial/2-requests-and-responses/index.html
+++ b/tutorial/2-requests-and-responses/index.html
@@ -547,7 +547,7 @@ http --json POST http://127.0.0.1:8000/snippets/ code="print 456"
     "id": 4,
     "title": "",
     "code": "print 456",
-    "linenos": true,
+    "linenos": false,
     "language": "python",
     "style": "friendly"
 }
diff --git a/tutorial/quickstart/index.html b/tutorial/quickstart/index.html
index 64243dc0..b81e1dc4 100644
--- a/tutorial/quickstart/index.html
+++ b/tutorial/quickstart/index.html
@@ -403,7 +403,7 @@ pip install django
 pip install djangorestframework
 
 # Set up a new project with a single application
-django-admin.py startproject tutorial .
+django-admin.py startproject tutorial .  # Note the trailing '.' character
 cd tutorial
 django-admin.py startapp quickstart
 cd ..
-- 
cgit v1.2.3