From 1283f437c3b2e877d2e2fe55b4cf0058f6ef7776 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 25 Oct 2021 14:22:23 +0700 Subject: [PATCH] use admin pw hash as secret_key --- tubearchivist/config/settings.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tubearchivist/config/settings.py b/tubearchivist/config/settings.py index 465e73f4..349203c7 100644 --- a/tubearchivist/config/settings.py +++ b/tubearchivist/config/settings.py @@ -10,6 +10,7 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ +import hashlib from os import environ, path from pathlib import Path @@ -22,8 +23,8 @@ BASE_DIR = Path(__file__).resolve().parent.parent # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = "Fvid^aUL6LohRZz*kZFvq85B&JW&kB9o*#jdzWsdWE8*XkCLR8" +PW_HASH = hashlib.sha256(environ.get("DJANGO_SUPERUSER_PASSWORD").encode()) +SECRET_KEY = PW_HASH.hexdigest() # SECURITY WARNING: don't run with debug turned on in production! DEBUG = bool(environ.get("DJANGO_DEBUG"))