title: secure django file permissions
body: <p>I am looking for a baseline set of file permissions to keep a django installation as secure as possible.</p>
  
  <p>I cannot seem to find any obvious reference either on the Django site or Google. </p>
  
  <p>Any links or clues?</p>
  
  <p>I use Apache + mod_wsgi + django. I have no upload directories to permission.  This is a really basic setup.</p>
  
  <p>I am currently running my code successfully thus:</p>
  
  <pre><code>/var/www/djangodir 
                    /django
                    /3rdpartyapp
                    /myapp
                          /serverfiles/my.wsgi
  
  all directorys:   755 owned by root.root
  all files:        644 owned by root.root
  
  exceptions to all files
  -----------------------
  settings.py file: 400  owned by apache.apache
  my.wsgi:          400  owned by apache.apache
  </code></pre>
  
  <p>I dont like the 644 on all files and would like to tighten that up but can't seem to get away with 400 or 500.  The wsgi app cannot import anything from django if I do.</p>
  
  <p>Help!</p>