title: Django save file on localhost
body: <p>I'm working on a Django app (DRF), but I'm a JS engineer so this is all new to me.</p>
  
  <p>I have this in my models.py, outside of any actual models:</p>
  
  <pre><code>storage = S3Storage(aws_s3_bucket_name=settings.DOCUMENTS_BUCKET)
  upload_location = 'recordings/'
  </code></pre>
  
  <p>and this is a field it is used in, inside one of the models:</p>
  
  <pre><code>zip_file = models.FileField(
      upload_to=upload_location, storage=storage, null=True)
  </code></pre>
  
  <p>This works OK in production. However, I want to be able to test it locally, add those zip files when developing locally. So I've added this for <code>storage</code> and <code>upload_location</code>:</p>
  
  <pre><code>if settings.DEBUG:
    storage = FileSystemStorage(location='/')
    upload_location = ''
  </code></pre>
  
  <p>Then, when I try saving a file from admin on localhost, I get the following error:</p>
  
  <pre><code>[Errno 13] Permission denied: '/my-file.zip'
  </code></pre>
  
  <p>If I got it right, the app cannot just create that location somewhere on my file system. Maybe I'm wrong. How can I solve this?</p>