better printing of DOMAIN var

when in settings, any command prints again DOMAIN which is boring and
inefficient
This commit is contained in:
pedro 2024-11-05 04:00:35 +01:00
parent 79a34c9b55
commit a67fda6b51
3 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,6 @@
DOMAIN=localhost 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 DEMO=true
STATIC_ROOT=/tmp/static/ STATIC_ROOT=/tmp/static/

View File

@ -34,8 +34,6 @@ DEBUG = config('DEBUG', default=False, cast=bool)
DOMAIN = config("DOMAIN") DOMAIN = config("DOMAIN")
assert DOMAIN not in [None, ''], "DOMAIN var is MANDATORY" 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()) ALLOWED_HOSTS = config('ALLOWED_HOSTS', default=DOMAIN, cast=Csv())
assert DOMAIN in ALLOWED_HOSTS, f"DOMAIN {DOMAIN} is not in ALLOWED_HOSTS {ALLOWED_HOSTS}" assert DOMAIN in ALLOWED_HOSTS, f"DOMAIN {DOMAIN} is not in ALLOWED_HOSTS {ALLOWED_HOSTS}"

View File

@ -18,6 +18,8 @@ deploy() {
if [ "${DEBUG:-}" = 'true' ]; then if [ "${DEBUG:-}" = 'true' ]; then
./manage.py print_settings ./manage.py print_settings
else
echo "DOMAIN: ${DOMAIN}"
fi fi
# detect if existing deployment (TODO only works with sqlite) # detect if existing deployment (TODO only works with sqlite)