title: Emailing a Django PDF file without saving in a FileField
body: <p>I have been struggling to email a pdf file am generating(using weasy print),I would like to be able to email directly without saving the file in my model object(If I could just save it in a temporary location and email it).But keep Getting this error.
  <strong>'file() argument 1 must be encoded string without null bytes, not str</strong></p>
  
  <pre><code>pdf_file = HTML(string=rendered_html,
                  base_url=settings.MEDIA_ROOT).write_pdf()
  
  certificate = SimpleUploadedFile(
      'Certificate-' + '.pdf', pdf_file, content_type='application/pdf')
  
  attachment = certifcate.read()
  
  msg.attach_file(attachment, 'application/pdf')
  </code></pre>