Created
March 27, 2015 08:29
-
-
Save jayapal/487b3c4f3021f5a3d362 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def myview(request) | |
customer = request.session['Customer'] | |
template = preppy.getModule(settings.REPORTS_DIR + '/report_templates/prepfiles/hello.prep') | |
rmlText = template.get(customer) | |
response = HttpResponse(mimetype='application/pdf') | |
response['Content-Disposition'] = 'attachment; filename=hello.pdf' | |
pdf = rml2pdf.parseString(rmlText) | |
response.write(pdf.read()) | |
return response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment