Python 3 Support¶
No changes are required for anyone running an existing Tastpie installation. The API is completely backward-compatible, so you should be able to run your existing software without modification.
All tests pass under both Python 2 & 3.
Oauth Is Unsupported¶
Tastypie was depending on several Oauth libraries for that authentication mechanism. Unfortunately, none of them have been ported to Python 3. They’re still usable from Python 2, but that will be blocked until the underlying libraries port (or an alternative can be found).
Several requirements have changed under Python 3 (mostly due to unofficial ports). They are:
- python3-digest instead of python-digest
- python-mimeparse instead of mimeparse
For explicitness, Django on Python 3 reads request bodies & sends response
bodies as binary data. This requires an explicit
was not required (but works fine) under Python 2. If you’re sending or reading
the bodies from Python, you’ll need to keep this in mind.
If you were testing things such as the XML/JSON generated by a given response, under Python 3.3.2+, hash randomization is in effect, which means that the ordering of dictionaries is no longer consistent, even on the same platform.
To mitigate this, Tastypie now tries to ensure that serialized data is sorted alphabetically. So if you were making string assertions, you’ll need to update them for the new payloads.