title: PermissionError: [Errno 13] Permission denied in Django
body: <p>I have encountered a very strange problem.</p>
  
  <p>I'm working with django, I create a directory on server, and try to save pickle file into it, this way:</p>
  
  <pre><code>with open(path, 'wb') as output: 
    pickle.dump(obj, output, pickle.HIGHEST_PROTOCOL)
  </code></pre>
  
  <p>And get:</p>
  
  <pre><code>PermissionError: [Errno 13] Permission denied
  </code></pre>
  
  <p>I tried to give all permissions to this directory, this way:</p>
  
  <pre><code>os.chmod(save_full_path, stat.S_IWOTH | stat.S_IWUSR | stat.S_IWGRP)
  </code></pre>
  
  <p>but this didn't help.</p>
  
  <p>Although directory seems to have all permissions(0o777), I still get this error.</p>
  
  <p>By the way, I have no problems with saving uploaded files to this directory.</p>
  
  <p>I'm very new to django, I would really appreciate if someone explained me what am I doing wrong. </p>