def get_content(response):
    try:
        return ''.join(chunk.decode() for chunk in response.streaming_content)
    except AttributeError:
        return response.content
Handle the incompatibilities between Django <=1.4 and 1.5+
dataset/ETHPy150Open smartfile/django-transfer/django_transfer/tests.py/get_content