From 66a529b783281d1a319d1ad0203d06593c0d920a Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Thu, 20 Apr 2017 11:26:50 -0300 Subject: [PATCH] =?UTF-8?q?HOT-FIX:=20permitir=20execu=C3=A7=C3=A3o=20do?= =?UTF-8?q?=20SAPL=20docker=20e=20standalone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gunicorn_start.sh | 9 +++++++++ start.sh | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gunicorn_start.sh b/gunicorn_start.sh index 9669644fa..5d82418df 100755 --- a/gunicorn_start.sh +++ b/gunicorn_start.sh @@ -23,6 +23,15 @@ DJANGO_WSGI_MODULE=sapl.wsgi # WSGI module name (*) echo "Starting $NAME as `whoami` on base dir $SAPL_DIR" +# parameter can be passed to run without virtualenv +if [[ "$@" != "no-venv" ]]; then + # Activate the virtual environment + cd $DJANGODIR + source /var/interlegis/.virtualenvs/sapl/bin/activate + export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE + export PYTHONPATH=$DJANGODIR:$PYTHONPATH +fi + # Create the run directory if it doesn't exist RUNDIR=$(dirname $SOCKFILE) test -d $RUNDIR || mkdir -p $RUNDIR diff --git a/start.sh b/start.sh index 226c70de4..0774b0e02 100755 --- a/start.sh +++ b/start.sh @@ -50,4 +50,4 @@ python3 manage.py migrate python3 manage.py collectstatic --no-input python3 manage.py rebuild_index --noinput -/bin/sh gunicorn_start.sh +/bin/sh gunicorn_start.sh no-venv