def generate_pdf_response(pdf_data, file_name):
    # TODO: unify with attachments
    response = HttpResponse(
        content=pdf_data, content_type='application/pdf',
    )
    response['Content-Disposition'] = 'attachment; filename="{}"'.format(
        file_name,
    )
    return response
Make a new DDP serializer.
dataset/ETHPy150Open allegro/ralph/src/ralph/helpers.py/generate_pdf_response--crossover with--dataset/ETHPy150Open django-ddp/django-ddp/dddp/__init__.py/serializer_factory