Guest User

Untitled

a guest
Apr 24th, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #NAME="ourcase" #Name of the application (*)
  4. DJANGODIR=/root/fedora-happiness-packets/ # Django project directory (*)
  5. SOCKFILE=/root/fedora-happiness-packets/fedorahappiness.sock # we will communicate using this uni$
  6. USER=root # the user to run as (*)
  7. GROUP=root # the group to run as (*)
  8. NUM_WORKERS=1 # how many worker processes should Gunicorn spawn (*)
  9. DJANGO_SETTINGS_MODULE=happinesspackets.settings.deployment # which settings file should Dja$
  10. DJANGO_WSGI_MODULE=happinesspackets.wsgi # WSGI module name (*)
  11.  
  12. # Activate the virtual environment
  13. cd $DJANGODIR
  14. source /root/fedora-happiness-packets/virtualenv/bin/activate
  15. export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
  16. export PYTHONPATH=$DJANGODIR:$PYTHONPATH
  17. export DJANGO_ALLOWED_HOSTS='209.132.184.123,happinesspackets-stg.fedorainfracloud.org'
  18. export SECRET_KEY='qd#+s9!u4w4e^!_lu)+unccz)vl7xhtp-xc+@1a28wkmn9)*fq'
  19. export DB_NAME='happinesspackets'
  20. export DB_USERNAME='myprojectuser'
  21. export DB_PASSWORD='tWykKkG8bzRTBfdT'
  22. export DJANGO_LOGFILE=/srv/logs/django.log
  23. export EMAIL_USER=''
  24. export EMAIL_PASSWORD=''
  25.  
  26. ./manage.py collectstatic
  27. python manage.py migrate
  28.  
  29. # Create the run directory if it doesn't exist
  30. RUNDIR=$(dirname $SOCKFILE)
  31. test -d $RUNDIR || mkdir -p $RUNDIR
  32.  
  33. # Start your Django Unicorn
  34. # Programs meant to be run under supervisor should not daemonize themselves (do not use --daemon)
  35. exec /root/fedora-happiness-packets/virtualenv/bin/gunicorn ${DJANGO_WSGI_MODULE}:application \
  36. --workers $NUM_WORKERS \
  37. --user $USER \
  38. --bind=unix:$SOCKFILE
Add Comment
Please, Sign In to add comment