These comparisons will break on python 3, instead do something like this to branch:
 
    from rest_framework.compat import six
    if isinstance(content, six.text_type):
       ...
    else:
        ...