Skip to content

Commit

Permalink
Use .env as dev_mode flag rockstor#2939
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
FroggyFlox committed Dec 24, 2024
1 parent 116b6eb commit b3600ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ PASSWORD_STORE_DIR=/root/.password-store

# Django
DJANGO_SETTINGS_MODULE=settings
#DJANGO_DEBUG=True
9 changes: 2 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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."
Expand Down

0 comments on commit b3600ca

Please sign in to comment.