response = PDFTemplateResponse(request, template=
    'reports/report_email.html', filename='weekly_report.pdf', context=
    render_data, cmd_options={'load-error-handling': 'ignore'})
subject, from_email, to = 'reports', 'digu35@gmail.com', 'digu35@gmail.com'
html_content = render_to_string('reports/report_email.html', render_data)
text_content = strip_tags(html_content)
msg = EmailMultiAlternatives(subject, text_content, from_email, [to])
msg.attach_alternative(html_content, 'text/html')
msg.attach('pdf_filename.pdf', response.rendered_content, 'application/pdf')
msg.send()
Any way to create PDF file with wkhtmltopdf without returning HttpResponse or using URL? I just want to attach PDF file to email