Django 如何设置gunicorn

Django 如何设置gunicorn,django,gunicorn,vps,Django,Gunicorn,Vps,我的django项目位于/root/code/mysite,django应用程序:主,主页。我应该在gunicorn.service中写什么?(Debian 9,用户根)下面是我的gunicorn服务(使用unix套接字)的systemd服务文件示例 签出欢迎来到stack overflow,请考虑签出,这个问题实际上非常不清楚,很难猜测您实际需要什么。 [Unit] Description=gunicorn daemon Requires=gunicorn.socket After=netwo

我的django项目位于
/root/code/mysite
,django应用程序:主,主页。我应该在gunicorn.service中写什么?(Debian 9,用户根)

下面是我的gunicorn服务(使用unix套接字)的systemd服务文件示例


签出

欢迎来到stack overflow,请考虑签出,这个问题实际上非常不清楚,很难猜测您实际需要什么。
[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target

[Service]
User=user
Group=user-group
EnvironmentFile=/home-dir/.env-file
WorkingDirectory=/path/to/project
ExecStart=/path/to/gunicorn \
          --access-logfile - \
          --log-level debug \
          --bind unix:/run/gunicorn.sock \
          wsgi-file:application --timeout 120 --workers=3

[Install]
WantedBy=multi-user.target