0

我想用这个

csv_file = 'static/result.csv'
with open(csv_file,'a') as f:

它适用于python manage runserver

然而,nginx_unit出现这样的错误,

PermissionError: [Errno 13] Permission denied: 'result.csv'

静态文件夹已经是 777

lrwxrwxrwx 1 ubuntu ubuntu 38 Dec 28 19:32 static

为什么会发生此权限错误?

在我的settings.py

STATIC_URL = '/static/'

STATICFILES_DIRS = (
    os.path.join(BASE_DIR, 'static'),
)

STATIC_ROOT = os.path.join(config("PROJ_PATH"), 'staticroot')

我的nginx_unit设置在下面

{
    "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"
        }
    }
}
4

0 回答 0