pdc_web.sh
526 Bytes
#/bin/env sh
#
# Shell wrapper to locally run the flask app as any user:
#
# sudo -u www-data ./pdc_web.sh
#
# Of course, any prerequisites, installation procedure and configuration files may have been fullfilled.
# See README.md and INSTALL.md for more details
#
SCRIPT_PATH=$(readlink -f $0)
SCRIPT_DIR=$(dirname $SCRIPT_PATH)
cd $SCRIPT_DIR
[ ! -f ./venv/bin/activate ] && echo "Create python virtual env ./venv/" && exit
[ ! -f .flaskenv ] && echo "Create .flaskenv file" && exit
. ./venv/bin/activate
flask run