from django.http import HttpResponse def json_response(context): response = HttpResponse(context) response['Content-Type'] = 'application/pdf' return response