title: Make file dynamically with nginx_unit and django
body: <p>I am trying to make with this</p>
  <pre><code>csv_file = 'static/result.csv'
  with open(csv_file,'a') as f:
  </code></pre>
  <p>It works on <code>python manage runserver</code></p>
  <p>However on <code>nginx_unit</code> there comes error like this,</p>
  <p><code>PermissionError: [Errno 13] Permission denied: 'result.csv'</code></p>
  <p>static folder is 777 already</p>
  <p><code>lrwxrwxrwx 1 ubuntu ubuntu    38 Dec 28 19:32 static</code></p>
  <p>Why this permission error happens??</p>
  <p>in my <code>settings.py</code></p>
  <pre><code>STATIC_URL = '/static/'
  
  STATICFILES_DIRS = (
      os.path.join(BASE_DIR, 'static'),
  )
  
  STATIC_ROOT = os.path.join(config(&quot;PROJ_PATH&quot;), 'staticroot')
  </code></pre>
  <p>my <code>nginx_unit</code> setting is here below</p>
  <pre><code>{
      &quot;listeners&quot;: {
          &quot;*:8010&quot;: {
              &quot;pass&quot;: &quot;applications/myapp&quot;,
          }
      },
  
      &quot;applications&quot;: {
          &quot;myapp&quot;: {
              &quot;type&quot;: &quot;python 3.8&quot;,
              &quot;module&quot;: &quot;myapp.wsgi&quot;,
              &quot;home&quot;: &quot;/home/ubuntu/anaconda3/envs/myapp/&quot;,
              &quot;path&quot;: &quot;/var/www/html/myapp/current&quot;
          }
      }
  }
  </code></pre>