From 47a93bc4cbb63c7f33a8a4dd97d96539ce6f9959 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 8 Apr 2021 21:01:52 +1000 Subject: [PATCH] More environment variables for config.yaml --- InvenTree/InvenTree/settings.py | 7 +++++-- InvenTree/config_template.yaml | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/InvenTree/InvenTree/settings.py b/InvenTree/InvenTree/settings.py index be9a4b729f..338a2dda9d 100644 --- a/InvenTree/InvenTree/settings.py +++ b/InvenTree/InvenTree/settings.py @@ -409,7 +409,7 @@ reqiured_keys = ['ENGINE', 'NAME'] for key in reqiured_keys: if key not in db_config: - error_msg = f'Missing required database configuration value {key} in config.yaml' + error_msg = f'Missing required database configuration value {key}' logger.error(error_msg) print('Error: ' + error_msg) @@ -503,7 +503,10 @@ LOCALE_PATHS = ( os.path.join(BASE_DIR, 'locale/'), ) -TIME_ZONE = CONFIG.get('timezone', 'UTC') +TIME_ZONE = get_setting( + 'INVENTREE_TIMEZONE', + CONFIG.get('timezone', 'UTC') +) USE_I18N = True diff --git a/InvenTree/config_template.yaml b/InvenTree/config_template.yaml index fb30f2d339..9e18adb759 100644 --- a/InvenTree/config_template.yaml +++ b/InvenTree/config_template.yaml @@ -49,6 +49,7 @@ 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 +# Use the environment variable INVENTREE_TIMEZONE timezone: UTC # List of currencies supported by default. @@ -63,6 +64,7 @@ currencies: - USD # Set debug to False to run in production mode +# Use the environment variable INVENTREE_DEBUG debug: True # Set debug_toolbar to True to enable a debugging toolbar for InvenTree @@ -71,6 +73,7 @@ debug: True debug_toolbar: False # Configure the system logging level +# Use environment variable INVENTREE_LOG_LEVEL # Options: DEBUG / INFO / WARNING / ERROR / CRITICAL log_level: WARNING