title: OSError: [Errno 1] Operation not permitted
body: <p>Trying to do chmod in Django (from Apache process). However, getting the following error. How can I rig this to work?</p>
  
  <p>error:</p>
  
  <blockquote>
    <p>OSError: [Errno 1] Operation not permitted: myfile</p>
  </blockquote>
  
  <p>code:</p>
  
  <pre><code>os.chmod(myfile, 0777)
  </code></pre>