mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-02 20:54:42 +03:00
Add note on compat import in tutorial
This commit is contained in:
parent
7bdb1b2eef
commit
02ae1682b5
|
@ -183,6 +183,8 @@ At this point we've translated the model instance into Python native datatypes.
|
|||
|
||||
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
|
||||
|
||||
stream = BytesIO(content)
|
||||
|
|
Loading…
Reference in New Issue
Block a user