Ensure contents is text-type so we won't trip assertions in django_compressor. Thanks to Johan for the report.