You need to import from rest_framework.compat import six
and then: use six.str
str is unicode in python3 but bytes in python2...