1
def email_page(request):
t = get_template('email.html')
email = EmailMessage('Hello', 'Test<br>break', '[email protected]',['[email protected]'])
email.content_subtype = "html"
workbook = xl.Workbook('ex.xlsx')
worksheet = workbook.add_worksheet()
worksheet.write(0, 0, 'Total')
workbook.close()
email.attach("ex.xlsx", workbook, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
email.send()
return HttpResponse(t.render(Context({})), status=200)
I tried the following changes on the email.attach line:Email xlsx Befestigung Django
workbook.read() - Lesen ist kein Attribut der Arbeitsmappe workbook.getvalue()
workbook.getvalue() - getvalue kein Attribut ist der Arbeitsmappe
Arbeitsmappe - Typeerror: 'Datei' Objekt unterstützt keine Indizierung