1👍
✅
alumn_list
is a view. So it returns an HttpResponse
object. But you need to pass a byte string to pisa.CreatePDF
which is response’s content. So you could do the following:
pisaStatus = pisa.CreatePDF(html.content, dest=pdfFile)
Source:stackexchange.com