diff --git a/conf/wish.secrets b/conf/deploycfg.py similarity index 100% rename from conf/wish.secrets rename to conf/deploycfg.py diff --git a/wish/settings.py b/wish/settings.py index 090ccc2..36ad068 100644 --- a/wish/settings.py +++ b/wish/settings.py @@ -12,6 +12,7 @@ https://docs.djangoproject.com/en/3.1/ref/settings/ from pathlib import Path from os.path import isfile +import os DEBUG = True # Bad, old, already has been in Git... @@ -129,8 +130,9 @@ USE_TZ = True AUTH_USER_MODEL = 'utils.MyUser' - -SECRETS_FILE = '~/wish.secrets' +_HOME_ENV = os.getenv('HOME', '/home/wish') +_CONFIG_DIR = os.getenv('XDG_CONFIG_DIR', _HOME_ENV + '/.config/wish') +SECRETS_FILE = _CONFIG_DIR + '/deploycfg.py' # Override settings if isfile(SECRETS_FILE): with open(SECRETS_FILE, "r") as f: