Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #NAME="ourcase" #Name of the application (*)
- DJANGODIR=/root/fedora-happiness-packets/ # Django project directory (*)
- SOCKFILE=/root/fedora-happiness-packets/fedorahappiness.sock # we will communicate using this uni$
- USER=root # the user to run as (*)
- GROUP=root # the group to run as (*)
- NUM_WORKERS=1 # how many worker processes should Gunicorn spawn (*)
- DJANGO_SETTINGS_MODULE=happinesspackets.settings.deployment # which settings file should Dja$
- DJANGO_WSGI_MODULE=happinesspackets.wsgi # WSGI module name (*)
- # Activate the virtual environment
- cd $DJANGODIR
- source /root/fedora-happiness-packets/virtualenv/bin/activate
- export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
- export PYTHONPATH=$DJANGODIR:$PYTHONPATH
- export DJANGO_ALLOWED_HOSTS='209.132.184.123,happinesspackets-stg.fedorainfracloud.org'
- export SECRET_KEY='qd#+s9!u4w4e^!_lu)+unccz)vl7xhtp-xc+@1a28wkmn9)*fq'
- export DB_NAME='happinesspackets'
- export DB_USERNAME='myprojectuser'
- export DB_PASSWORD='tWykKkG8bzRTBfdT'
- export DJANGO_LOGFILE=/srv/logs/django.log
- export EMAIL_USER=''
- export EMAIL_PASSWORD=''
- ./manage.py collectstatic
- python manage.py migrate
- # Create the run directory if it doesn't exist
- RUNDIR=$(dirname $SOCKFILE)
- test -d $RUNDIR || mkdir -p $RUNDIR
- # Start your Django Unicorn
- # Programs meant to be run under supervisor should not daemonize themselves (do not use --daemon)
- exec /root/fedora-happiness-packets/virtualenv/bin/gunicorn ${DJANGO_WSGI_MODULE}:application \
- --workers $NUM_WORKERS \
- --user $USER \
- --bind=unix:$SOCKFILE
Add Comment
Please, Sign In to add comment