title: Django: "[Errno 13] Permission denied: '/samples'" during file upload via model
body: <p>I'm trying to push a sample file from admin page, via a model. Whole website works fine but I'm just getting this problem with this specific model.</p>
  <blockquote>
  <p><strong>Model</strong></p>
  </blockquote>
  <pre><code>class File(models.Model):
      area = models.OneToOneField(Actions, on_delete=CASCADE)
      sample_file = models.FileField(
          upload_to='samples/', validators=[validate_file_extension])
  </code></pre>
  <blockquote>
  <p><strong>Info</strong></p>
  </blockquote>
  <p><code>samples/</code> Directory relies in <code>BASE_DIR</code> of project.</p>
  <blockquote>
  <p><strong>Tried Fixes</strong></p>
  </blockquote>
  <p>Read few articles, and got few ideas about permissions but my permissions are correct as well, folder is under www-data</p>
  <p><code>drwxr-xr-x  2 www-data www-data   4096 Sep 24 17:53 samples</code></p>
  <p>I even tired changing permissions to <code>777</code> but didn't worked.</p>
  <p>Am I missing something here.</p>