filename = now.strftime('%Y-%m-%d') + '.pdf'
response = HttpResponse(mimetype='application/pdf')
response['Content-Disposition'] = 'attachment; filename=' + filename
How to generate a PDF from an HTML / CSS (including images) source in Python?