Gunicorn for Django的系统服务

问题描述 投票:0回答:1

我在ubuntu 18.04上使用vps,并且为我的Django应用程序创建了Gunicorn的以下systemd服务,并以postgres作为数据库:

[Unit]
Description=Gunicorn
After=network.target

[Service]
Type=simple
User=django
ExecStart=/bin/bash /home/django/bin/start-server.sh
Restart=on-failure

[Install]
WantedBy=multi-user.target

但是启用gunicorn后,我出现服务器错误(500)。错误说:

OperationalError位于/致命:用户“ root”的对等身份验证失败]

我必须做些什么才能使它正确?

django service system gunicorn
1个回答
0
投票
问题是我的ubuntu操作系统的用户不是我在服务中所使用的用户。
© www.soinside.com 2019 - 2024. All rights reserved.