def test_qr(request):
    response = HttpResponse(mimetype='application/pdf')
response['Content-Disposition'] = 'attachment; filename="somefilename.pdf"'
p = canvas.Canvas(response)
qrw = QrCodeWidget('Helo World!')
b = qrw.getBounds()
w = b[2] - b[0]
h = b[3] - b[1]
d = Drawing(45, 45, transform=[45.0 / w, 0, 0, 45.0 / h, 0, 0])
d.add(qrw)
renderPDF.draw(d, p, 1, 1)
p.showPage()
p.save()
return response
Generate multiple qr codes in one pdf file using reportlab and django framework