使用Gunicorn,Nginx在Centos 8上部署Django项目(Gunicorn.service问题)

时间:2020-05-15 13:02:03

标签: python django nginx gunicorn centos8

我遵循了本教程

https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-centos-7

  1. 试图在 centos 8 上部署Django项目
  2. gunicorn.service
  3. 之外,其他一切都正常运行
["1","2","3"];
["1","2","9"];
["1","4","5"];
["1","4","12"];
["6","7","8"];
  1. 文件夹目的地

  2. 我的项目文件夹目标 '/ home / facealatoo / nadyr / promed' settings.py文件 'home / facealatoo / nadyr / promed / configs / settings.py'
  3. 服务器用户名 'facealatoo'
  4. 运行后
var test = new List<List<string>>();
test.Add(new List<string> {"1","2","3"});
test.Add(new List<string> {"1","4","5"});
test.Add(new List<string> {"1","2","3"});
test.Add(new List<string> {"1","4","5"});
test.Add(new List<string> {"6","7","8"});

var query = test.AsQueryable();
query = query.OrderBy(a=>a[0]);
var max = categories.Select(a=>a.Count()).Max();
for (int i = 1; i < max; i++)
{
    query = query.ThenBy(a=>a[i]); // Error Here
}
var sorted = query.ToList();

错误消息

    [Unit]
    Description=gunicorn daemon
    After=network.target
        
    [Service]
    User=facealatoo
    Group=nginx
    WorkingDirectory=/home/facealatoo/nadyr/promed
    ExecStart=/home/facealatoo/nadyr/promed/venv/bin/gunicorn \ 
        --workers 3 \
        --bind unix:/home/facealatoo/nadyr/promed/promed.sock \
        configs.wsgi:application

    [Install]
    WantedBy=multi-user.target

请帮助我! ;)预先感谢))))

1 个答案:

答案 0 :(得分:0)

我只是更改套接字文件的目标位置(home / facealatoo(user)/)和gunicorn的目标位置(usr / local / bin / gunicorn)。这些动作解决了我的问题)))