[Django]-Running Gunicorn behind chrooted nginx inside virtualenv

0πŸ‘

βœ…

I know this isn’t the best way, but I was able to get it working by adding gunicorn to the list of django INSTALLED_APPS. Then I just created a new systemd service:

[Unit]
Description=hack way to start gunicorn and django

[Service]
User=http
Group=http
ExecStart=/srv/http/www/nlp.com/nlp/bin/python /srv/http/www/nlp.com/nlp/nlp/manage.py run_gunicorn
Restart=always
[Install]
WantedBy=multi-user.target

There must be a better way, but judging by the lack of responses not many people know what that better way is.

πŸ‘€noel

0πŸ‘

I had a similar problem on OSX with launchd.
The issue was I needed to allow for the process to spawn sub processes.

Try adding Type=forking:

[Unit]
Description=gunicorn-app

[Service]
Type=forking
πŸ‘€user1690442

Leave a comment