Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- NAME="gunicorn-dev" #Name of the application (*)
- DJANGODIR=/var/www/dev/dashboard/dashboard/ # Django project directory (*)
- SOCKFILE=/var/www/dev/run.sock # we will communicate using this unix socket (*)
- USER=mineradmin # the user to run as (*)
- GROUP=mineradmin # the group to run as (*)
- NUM_WORKERS=3 # how many worker processes should Gunicorn spawn (*)
- LOGLEVEL=debug
- DJANGO_SETTINGS_MODULE=dashboard.settings # which settings file should Django use (*)
- DJANGO_WSGI_MODULE=dashboard.wsgi # WSGI module name (*)
- # Activate the virtual environment
- source /var/www/dev/.env/bin/activate
- export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
- export PYTHONPATH=$DJANGODIR:$PYTHONPATH
- export ADMINMIN_PASSWORD=<put_password_here>
- cd $DJANGODIR
- # Start your Django Unicorn
- # Programs meant to be run under supervisor should not daemonize themselves (do not use --daemon)
- exec /var/www/dev/.env/bin/gunicorn ${DJANGO_WSGI_MODULE}:application \
- --name $NAME \
- --workers $NUM_WORKERS \
- --user $USER \
- --bind unix:$SOCKFILE \
- --access-logfile /var/www/dev/logs/access.log \
- --error-logfile /var/www/dev/logs/error.log \
- --log-level $LOGLEVEL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement