title: " Errno 13 Permission denied 'bnr_code.csv'"?
body: <p>I have deployed  a Django project on server using apache2 and wsgi, Its showing an error which I probably know that why its coming.</p>
  
  <p>Error:</p>
  
  <pre><code>IOError at /
  [Errno 13] Permission denied: 'bnr_code.csv'
  Request Method: GET
  Request URL:    http://93.188.167.63:8080/pep_learn/
  Django Version: 1.10.8
  Exception Type: IOError
  Exception Value:    
  [Errno 13] Permission denied: 'bnr_code.csv'
  Exception Location: /home/pep_web/binaryDs/views.py in &lt;module&gt;, line 6
  Python Executable:  /usr/bin/python
  Python Version: 2.7.12
  </code></pre>
  
  <p>I have tried some slandered solutions which are available as given bellow:</p>
  
  <p>chmod 777 pep_web/</p>
  
  <p>chmod 771 pep_web/</p>
  
  <p>sudo chown :www-data pep_web/</p>
  
  <p>But nothing is working</p>
  
  <p>This is the file  which uses 'bnr_code.csv' </p>
  
  <pre><code>AA = {"A":"1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
        "C":"0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
        "D":"0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
        "E":"0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
        "F":"0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
        "G":"0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
        "H":"0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0",
        "I":"0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0",
        "K":"0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0",
        "L":"0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0",
        "M":"0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0",
        "N":"0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0",
        "P":"0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0",
        "Q":"0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0",
        "R":"0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0",
        "S":"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0",
        "T":"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0",
        "V":"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0",
        "W":"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0",
        "Y":"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1"}
  
  
  
  line = []
  seqs = ["ATTTRY","ATSSRY"]
  
  
  def bnr(x):
      Des = []
      for n in x:
          Des.append(AA[n.upper()])
      des = ",".join(Des)
      return des
  
  def Des_write(ps):
      f = open("bnr_code.csv",'w')
      for p in ps:
          a  = bnr(p)
          f.write(p+','+a+'\n')
      f.close()
  
  
  Des_write(seqs)
  </code></pre>
  
  <p><strong>Please help One can examine the error at <a href="http://93.188.167.63:8080/pep_learn/" rel="nofollow noreferrer">http://93.188.167.63:8080/pep_learn/</a></strong></p>