From a67fda6b510b34fb5937e9fc9c9358e306be52c0 Mon Sep 17 00:00:00 2001 From: pedro Date: Tue, 5 Nov 2024 04:00:35 +0100 Subject: [PATCH] better printing of DOMAIN var when in settings, any command prints again DOMAIN which is boring and inefficient --- .env.example | 3 ++- dhub/settings.py | 2 -- docker/devicehub-django.entrypoint.sh | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index ce046cd..cb97c80 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,6 @@ DOMAIN=localhost -# note that DEBUG=true make snapshot parsing more verbose +# note that with DEBUG=true, logs are more verbose (include tracebacks) +DEBUG=true DEMO=true STATIC_ROOT=/tmp/static/ diff --git a/dhub/settings.py b/dhub/settings.py index d93f719..0dc3d84 100644 --- a/dhub/settings.py +++ b/dhub/settings.py @@ -34,8 +34,6 @@ DEBUG = config('DEBUG', default=False, cast=bool) DOMAIN = config("DOMAIN") assert DOMAIN not in [None, ''], "DOMAIN var is MANDATORY" -# this var is very important, we print it -print("DOMAIN: " + DOMAIN) ALLOWED_HOSTS = config('ALLOWED_HOSTS', default=DOMAIN, cast=Csv()) assert DOMAIN in ALLOWED_HOSTS, f"DOMAIN {DOMAIN} is not in ALLOWED_HOSTS {ALLOWED_HOSTS}" diff --git a/docker/devicehub-django.entrypoint.sh b/docker/devicehub-django.entrypoint.sh index bdf1008..fb057f9 100644 --- a/docker/devicehub-django.entrypoint.sh +++ b/docker/devicehub-django.entrypoint.sh @@ -18,6 +18,8 @@ deploy() { if [ "${DEBUG:-}" = 'true' ]; then ./manage.py print_settings + else + echo "DOMAIN: ${DOMAIN}" fi # detect if existing deployment (TODO only works with sqlite)