title: Django file upload: permission problem, error 13
body: <p>I'm creating a django module to upload files, and i'm following this django documentation:  <a href="https://docs.djangoproject.com/en/dev/topics/http/file-uploads/" rel="nofollow">FileUploads</a></p>
  
  <p>But when it executes 
  <code>
  destination=destination = open('/media/name.txt','wb+')</code></p>
  
  <p>it throws this error: </p>
  
  <blockquote>
    <p>[Errno 13] Permission denied: '/media/name.txt'</p>
  </blockquote>
  
  <p>My settings are:</p>
  
  <ol>
  <li>a folder 'media' in root of django project</li>
  <li>in settings.py MEDIA_ROOT is /home/user/...django_project_folder/media/ and MEDIA_URL is  <a href="http://127.0.0.1:8000/media/" rel="nofollow">http://127.0.0.1:8000/media/</a></li>
  <li>folder media has 777 as permissions, and executing ls -l media's owner is the same that runs the project (checked through lsof -i command)</li>
  </ol>
  
  <p>Due these settings, i consider very strange this error.</p>
  
  <p>Some help? </p>