alpine uses TZ to set OS timezone, to stay consistent

changed TIMEZONE env variable to TZ
added deprecated warning to TIMEZONE
This commit is contained in:
smilerz 2023-11-28 11:47:23 -06:00
parent ad036d7e6c
commit 6af28e6fe5
No known key found for this signature in database
GPG Key ID: 39444C7606D47126
2 changed files with 6 additions and 2 deletions

View File

@ -28,7 +28,7 @@ SECRET_KEY_FILE=
# ---------------------------------------------------------------
# your default timezone See https://timezonedb.com/time-zones for a list of timezones
TIMEZONE=Europe/Berlin
TZ=Europe/Berlin
# add only a database password if you want to run with the default postgres, otherwise change settings accordingly
DB_ENGINE=django.db.backends.postgresql

View File

@ -450,7 +450,11 @@ for p in PLUGINS:
LANGUAGE_CODE = 'en'
TIME_ZONE = os.getenv('TIMEZONE') if os.getenv('TIMEZONE') else 'Europe/Berlin'
if os.getenv('TIMEZONE') is not None:
print('DEPRECATION WARNING: Environment var "TIMEZONE" is deprecated. Please use "TZ" instead.')
TIME_ZONE = bool(int(os.getenv('REVERSE_PROXY_AUTH', False)))
else:
TIME_ZONE = os.getenv('TZ') if os.getenv('TZ') else 'Europe/Berlin'
USE_I18N = True