title: Django - User uploaded S3 files in the view
body: <p>I have a page where users can upload PDF / image files to their profile. The model for these files is relativly straightforward:</p>
  
  <pre><code>class ResumeItemFile(models.Model):
      item = models.ForeignKey(ResumeItem, related_name='attachment_files')
      file = models.FileField(
      max_length=255, upload_to=RandomizedFilePath('resume_attachments'),
      verbose_name=_('Attachment'))
      name = models.CharField(max_length=255, verbose_name=_('Naam'), blank=True)
  </code></pre>
  
  <p>I am creating a view where all files linked to a profile (<code>item</code>) are gathered in a .zip file. I've got this working locally, but in production I run in the following error <code>NotImplementedError:  This backend doesn't support absolute paths.</code></p>
  
  <p>The main difference is that on production the mediafiles are served through S3</p>
  
  <pre><code>MEDIA_URL = 'https://******.s3.amazonaws.com/'
  STATIC_URL = MEDIA_URL
  
  DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
  STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
  </code></pre>
  
  <p>In my view I created a list of the ResumeItemFile in the <code>attachments</code> variable, which is a list of dicts that look like this: <code>{'filename', ResumeItemFileObject}</code></p>
  
  <pre><code>            for file in attachments:
  
                  storage = DefaultStorage()
                  filename = file[1]
                  file_extension = str(file[0].file).split('.')[-1]
                  file_object = storage.open(file[0].file.path, mode='rb')                   
                  filename, file_object.read())
                  file_object.close()
  </code></pre>
  
  <p>Though this works fine locally, on staging it crashes on the <code>file_object = storage.open(file[0].file.path, mode='rb')</code> line. </p>
  
  <p>If the backend does not support absolute paths, how I am to select the correct file? Does anyone have an idea of what I am doing wrong?</p>