3

I continuously get this error message when trying to deploy my Django app with Nginx and Gunicorn. I've almost read and implemented all suggestions about this issue on ST.Overflow I've already implemented the following.

1. Ensured there is a shebang: #!/bin/bash

2. Put sh in front of command in /etc/supervisor/conf.d/clouditech.conf

Please find my configuration files

  1. /etc/supervisor/conf.d/clouditech.conf
[program:clouditech]
command =sh /home/clouditech/bin/gunicorn_start
user=clouditech
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/home/clouditech/logs/gunicorn-error.log

  1. gunicorn_start file

/home/clouditech/bin/gunicorn_start

#!/bin/bash

NAME="core"
DIR=/home/clouditech/clouditech
USER=clouditech
GROUP=clouditech
WORKERS=3
BIND=unix:/home/clouditech/run/gunicorn.sock
DJANGO_SETTINGS_MODULE=core.settings
DJANGO_WSGI_MODULE=core.wsgi
LOG_LEVEL=error

cd $DIR
source ../bin/activate

export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
export PYTHONPATH=$DIR:$PYTHONPATH

exec ../bin/gunicorn ${DJANGO_WSGI_MODULE}:application \
  --name $NAME \
  --workers $WORKERS \
  --user=$USER \
  --group=$GROUP \
  --bind=$BIND \
  --log-level=$LOG_LEVEL \
  --log-file=-
sam hassan
  • 197
  • 3
  • 14
  • Hey, I have the same problem. Have you found a solution? – pauzca Oct 27 '21 at 20:59
  • 1
    Yes, buddy. I've documented the process [Here](https://www.cloudbintech.com/detail/simply-host-django-application-with-nginx-gunicorn-and-postgresql/) – sam hassan Oct 28 '21 at 14:08

0 Answers0