Advertisement
Guest User

Untitled

a guest
Jan 24th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. NAME="wsgi" # Name of the application
  4. DJANGODIR=/home/idxtra/.projects/visitapp_server/src/visitapp # Django project directory
  5. SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket
  6. USER=idxtra # the user to run as
  7. GROUP=webapps # the group to run as
  8. NUM_WORKERS=5 # how many worker processes should Gunicorn spawn
  9. DJANGO_SETTINGS_MODULE=visitapp.settings # which settings file should Django use
  10. DJANGO_WSGI_MODULE=wsgi.wsgi # WSGI module name
  11. TIMEOUT=100
  12.  
  13. echo "Starting $NAME as `whoami`"
  14.  
  15. # Activate the virtual environment
  16. cd $DJANGODIR
  17. source ../../env/bin/activate
  18. export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
  19. # export PYTHONPATH=$DJANGODIR:$PYTHONPATH
  20.  
  21. # Create the run directory if it doesn't exist
  22. #RUNDIR=$(dirname $SOCKFILE)
  23. #test -d $RUNDIR || mkdir -p $RUNDIR
  24.  
  25. # Start your Django Unicorn
  26. # Programs meant to be run under supervisor should not daemonize themselves (do not use --daemon)
  27. # Programs meant to be run under supervisor should not daemonize themselves (do not use --daemon)
  28. exec gunicorn wsgi \
  29. --name $NAME \
  30. --timeout $TIMEOUT \
  31. --workers $NUM_WORKERS \
  32. --log-level=debug \
  33. --log-file=-
  34.  
  35.  
  36.  
  37.  
  38. #!/bin/bash
  39.  
  40. DJANGODIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  41. echo $DJANGODIR
  42. DJANGO_SETTINGS_MODULE=visitapp.settings
  43.  
  44. echo "Starting celery"
  45.  
  46. cd $DJANGODIR
  47. source ../../env/bin/activate
  48. export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
  49. exec celery -A visitapp worker -l info --concurrency 6 -B
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement