title: How to attach S3 file to email in Django
body: <p>I'm trying to attach a media file saved in an S3 bucket to an email, which I'm doing with this line of code:</p>
  
  <pre><code>email.attach_file(standard.download.url)
  </code></pre>
  
  <p>The model is defined as follows:</p>
  
  <pre><code>class Standard(models.Model):
      name = models.CharField(max_length = 51)
      download = models.FileField(upload_to="standard_downloads/", null=True, blank=True)
  
      def __str__(self):
          return self.name
  </code></pre>
  
  <p>Within <code>settings.py</code> I have defined my media files as follows:</p>
  
  <pre><code>AWS_DEFAULT_ACL = 'public-read'
  AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME
  AWS_S3_OBJECT_PARAMETERS = {
      'CacheControl': 'max-age=86400',
  }
  DEFAULT_FILE_STORAGE = 'sme.storage_backends.MediaStorage'
  MEDIA_ROOT = 'https://%s.s3.amazonaws.com/media/' % AWS_STORAGE_BUCKET_NAME
  </code></pre>
  
  <p>When trying to run the code I'm getting</p>
  
  <blockquote>
    <p>No such file or directory:
    'https:/bucket-name.s3.amazonaws.com/media/standard_downloads/filename.ext</p>
  </blockquote>
  
  <p>Please note it is showing as <code>https:/</code> (a single /).  How do I correct this?</p>