feature: use env to config django's settings path

This commit is contained in:
winkidney
2022-04-14 08:08:56 -07:00
parent c97805cae5
commit 7e158a269c

View File

@@ -9,18 +9,19 @@
# Updated: Aug 19th, 2014
# -----------------------------------------------------------------------------
PROJECT_ROOT="/pinry"
export DJANGO_SETTINGS_MODULE=pinry.settings.docker
bash ${PROJECT_ROOT}/docker/scripts/bootstrap.sh
# If static files don't exist collect them
cd ${PROJECT_ROOT}
python manage.py collectstatic --noinput --settings=pinry.settings.docker
python manage.py collectstatic --noinput
# If database doesn't exist yet create it
if [ ! -f /data/production.db ]
then
cd ${PROJECT_ROOT}
python manage.py migrate --noinput --settings=pinry.settings.docker
python manage.py migrate --noinput
fi
# Fix all settings after all commands are run