Skip to content

Instantly share code, notes, and snippets.

@blorenz
Last active December 21, 2015 06:29
Show Gist options
  • Save blorenz/6264545 to your computer and use it in GitHub Desktop.
Save blorenz/6264545 to your computer and use it in GitHub Desktop.
Activating virtualenvs for use with supervisord example /etc/supervisord.conf: [program:PROJECT] command = /virtualenvs/virtualenv_cmd.sh /virtualenvs/VIRTUALENV python PROJECT/manage.py run_gunicorn -b 127.0.0.1:9920 -t 1200
#!/bin/bash
# Activating virtualenvs for use with supervisord example /etc/supervisord.conf:
# [program:PROJECT]
# command = /virtualenvs/virtualenv_cmd.sh /virtualenvs/VIRTUALENV python PROJECT/manage.py run_gunicorn -b
VIRTUAL_ENV=$1
if [ -z $VIRTUAL_ENV ]; then
echo "usage: $0 </path/to/virtualenv> <cmds>"
exit 1
fi
. $VIRTUAL_ENV/bin/activate
shift 1
exec "$@"
deactivate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment