diff --git a/monitoring/settings.ini b/monitoring/settings.ini index 33ac1ba..222b25c 100644 --- a/monitoring/settings.ini +++ b/monitoring/settings.ini @@ -1,6 +1,9 @@ # This file will be parsed by settings.py. [common] +# A new key can be generated using django.core.management.utils.get_random_secret_key() +secret_key = + # `allowed_hosts` values should be comma separated list of hostnames (fqdn's) allowed_hosts = diff --git a/monitoring/settings.py b/monitoring/settings.py index 724f7d9..fcd1764 100644 --- a/monitoring/settings.py +++ b/monitoring/settings.py @@ -18,10 +18,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'ge^fd9rf)htmxji8kf=jk8frh3=^11@^n=h14gu*fqt^0-lnr$' +# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False @@ -33,6 +30,9 @@ file_path = os.path.join(BASE_DIR, 'monitoring', 'settings.ini') cp.read(file_path) + # SECURITY WARNING: keep the secret key used in production secret! + SECRET_KEY = cp.get('common', 'secret_key') + ALLOWED_HOSTS = cp.get('common', 'allowed_hosts').split(',') # Database