From 3d60bccae0cb0f4015f1c4bd64cb1b83fcf8ae12 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 8 Oct 2020 21:02:38 +1100 Subject: [PATCH] Add support for setting timezone in config.yaml --- InvenTree/InvenTree/settings.py | 3 +-- InvenTree/config_template.yaml | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/InvenTree/InvenTree/settings.py b/InvenTree/InvenTree/settings.py index c6f8b40069..208220e23a 100644 --- a/InvenTree/InvenTree/settings.py +++ b/InvenTree/InvenTree/settings.py @@ -355,8 +355,7 @@ LOCALE_PATHS = ( os.path.join(BASE_DIR, 'locale/'), ) - -TIME_ZONE = 'UTC' +TIME_ZONE = CONFIG.get('timezone', 'UTC') USE_I18N = True diff --git a/InvenTree/config_template.yaml b/InvenTree/config_template.yaml index 0a60e205a1..94ec36bec7 100644 --- a/InvenTree/config_template.yaml +++ b/InvenTree/config_template.yaml @@ -21,6 +21,11 @@ database: # Select default system language (default is 'en-us') language: en-us +# System time-zone (default is UTC) +# Reference: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones +# Select an option from the "TZ database name" column +timezone: UTC + # Set debug to False to run in production mode debug: True