启动 Gunicorn 时出错:"Worker failed to boot"

Error during starting Gunicorn: "Worker failed to boot"

我正在尝试使用 Gunicorn 和 Nginx 将 Django 项目部署到 DigitalOcean。

当我尝试启动 Gunicorn 时出现错误:"Worker failed to boot"

cd /opt/blog/src && /opt/blog/env/bin/gunicorn core.wsgi:application --bind 0.0.0.0:8000

错误:

gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>

这是我的项目结构:

/opt/blog/
    env/
    src/
        core/
            wsgi.py

在我的 settings.py:

DEBUG=False
ALLOWED_HOSTS = ['*']

/etc/init/gunicorn.conf:

description "Gunicorn application server handling blog."

start on runlevel [2345]
stop on runlevel [!2345]

respawn
setuid nobody
setgid nogroup
chdir /opt/blog/src

exec /opt/blog/env/bin/gunicorn --workers 3 --bind 0.0.0.0:8000 core.wsgi:application

/etc/nginx/sites-available/umutcoskun.com:

server {
    server_name umutcoskun.com www.umutcoskun.com;

    access_log off;

    location /static/ {
        alias /opt/blog/static/;
    }

    location / {
        proxy_pass http://0.0.0.0:8000;
        proxy_set_header X-Forwarded-Host $server_name;
        proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Host $proxy_add_x_forwarded_for;
        add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';
    }
}

我哪里出错了?

当我使用“--preload”运行 gunicorn 命令时,出现此错误:

ValueError: Unable to configure root logger: Unable to add handler 'sentry': 'sentry'"

然后我从 settings.py 中的记录器处理程序中删除了 sentry。 然后错误修复。