Corrected tutorial 1 example renderer output to bytes. (#6486)

This commit is contained in:
Luoxzhg 2019-03-05 18:50:13 +08:00 committed by Carlton Gibson
parent ac7b20cca2
commit dfc277cce6

View File

@ -150,7 +150,7 @@ At this point we've translated the model instance into Python native datatypes.
content = JSONRenderer().render(serializer.data)
content
# '{"id": 2, "title": "", "code": "print(\\"hello, world\\")\\n", "linenos": false, "language": "python", "style": "friendly"}'
# b'{"id": 2, "title": "", "code": "print(\\"hello, world\\")\\n", "linenos": false, "language": "python", "style": "friendly"}'
Deserialization is similar. First we parse a stream into Python native datatypes...