mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Adjustments for maintenance-mode options:
- Brings the state into the same directory as the runtime config file
This commit is contained in:
parent
7ba01612d8
commit
ae8166984f
@ -86,6 +86,9 @@ if not os.path.exists(cfg_filename):
|
|||||||
with open(cfg_filename, 'r') as cfg:
|
with open(cfg_filename, 'r') as cfg:
|
||||||
CONFIG = yaml.safe_load(cfg)
|
CONFIG = yaml.safe_load(cfg)
|
||||||
|
|
||||||
|
# We will place any config files in the same directory as the config file
|
||||||
|
config_dir = os.path.dirname(cfg_filename)
|
||||||
|
|
||||||
# Default action is to run the system in Debug mode
|
# Default action is to run the system in Debug mode
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = _is_true(get_setting(
|
DEBUG = _is_true(get_setting(
|
||||||
@ -206,6 +209,16 @@ if MEDIA_ROOT is None:
|
|||||||
print("ERROR: INVENTREE_MEDIA_ROOT directory is not defined")
|
print("ERROR: INVENTREE_MEDIA_ROOT directory is not defined")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
# Options for django-maintenance-mode : https://pypi.org/project/django-maintenance-mode/
|
||||||
|
MAINTENANCE_MODE_STATE_FILE_PATH = os.path.join(
|
||||||
|
config_dir,
|
||||||
|
'maintenance_mode_state.txt',
|
||||||
|
)
|
||||||
|
|
||||||
|
MAINTENANCE_MODE_IGNORE_ADMIN_SITE = True
|
||||||
|
|
||||||
|
MAINTENANCE_MODE_IGNORE_SUPERUSER = True
|
||||||
|
|
||||||
# List of allowed hosts (default = allow all)
|
# List of allowed hosts (default = allow all)
|
||||||
ALLOWED_HOSTS = CONFIG.get('allowed_hosts', ['*'])
|
ALLOWED_HOSTS = CONFIG.get('allowed_hosts', ['*'])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user