Skip to content

Instantly share code, notes, and snippets.

@casebeer
Created August 25, 2017 01:29
Show Gist options
  • Save casebeer/a3cbdcfe73589c62495b561d784a8224 to your computer and use it in GitHub Desktop.
Save casebeer/a3cbdcfe73589c62495b561d784a8224 to your computer and use it in GitHub Desktop.
Start Django and Celery, trapping SIGINT to terminate both daemons cleanly on Ctrl-C
#!/bin/bash
#
# Start Django and Celery, trapping SIGINT to terminate both daemons cleanly on Ctrl-C
#
PYTHON=venv/bin/python
DJANGO_DEV_SERVER_PORT=8000
$PYTHON ./manage.py runserver $DJANGO_DEV_SERVER_PORT "$@" &
#$PYTHON ./manage.py celeryd &
trap "kill -TERM -$$" SIGINT
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment