From 4fe6015ad695a9a39fb84688bddb00080d91b157 Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Fri, 24 Dec 2021 15:12:38 +0100 Subject: [PATCH] Rename deploy config file and chenge its location --- conf/{wish.secrets => deploycfg.py} | 0 wish/settings.py | 6 ++++-- 2 files changed, 4 insertions(+), 2 deletions(-) rename conf/{wish.secrets => deploycfg.py} (100%) 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: