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