From b3600ca8a8cc7d13c681e77cb43debbee91b6242 Mon Sep 17 00:00:00 2001 From: FroggyFlox Date: Tue, 24 Dec 2024 18:54:09 -0500 Subject: [PATCH] Use .env as dev_mode flag #2939 Rely on the DJANGO_DEBUG env variable to set DEBUG boolean that will in turn decide the installation of the dev group dependencies (includes the Django debug toolbar) as the appearance of the toolbar in the UI. Leave commented (= unset) by default to keep the default build NOT in the dev mode. --- .env | 1 + build.sh | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.env b/.env index f719655c8..6594770cc 100644 --- a/.env +++ b/.env @@ -12,3 +12,4 @@ PASSWORD_STORE_DIR=/root/.password-store # Django DJANGO_SETTINGS_MODULE=settings +#DJANGO_DEBUG=True diff --git a/build.sh b/build.sh index 370158000..903f4bb66 100755 --- a/build.sh +++ b/build.sh @@ -2,11 +2,6 @@ # exit on error set -o errexit -DEV_MODE=0 -if [ "$1" = "--dev" ]; then - DEV_MODE=1 -fi - # Install Poetry, a dependency management, packaging, and build system. # Uninstall legacy/transitional Poetry version of 1.1.15 PATH="/root/.local/bin:$PATH" # ensure legacy path. @@ -54,8 +49,8 @@ poetry --version >> poetry-install.txt poetry self show plugins >> poetry-install.txt # /usr/local/bin/poetry -> /opt/pipx/venvs/poetry -if [ $DEV_MODE -eq 1 ]; then - echo "Install djdt." +if [ "$DJANGO_DEBUG" = "True" ]; then + echo "Install Django Debug Toolbar." poetry install -vvv --no-interaction --no-ansi --with dev >> poetry-install-dev.txt 2>&1 else echo "Normal install."