Compare commits

...

2 commits

Author SHA1 Message Date
3eae827ed5 Add SECRET_KEY parsing to production.py
Prevents forgetting about this later!
2022-07-03 22:07:53 +01:00
fc44f550d2 Move some config around 2022-07-03 22:05:37 +01:00
3 changed files with 30 additions and 16 deletions

View file

@ -19,11 +19,9 @@ BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "django-insecure-lt9sfgmvcrjuiz!=l)3f50x&333&p4wi60t1@jdjtrho43ytl+"
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = False
ALLOWED_HOSTS = []
@ -70,17 +68,6 @@ TEMPLATES = [
WSGI_APPLICATION = "config.wsgi.application"
# Database
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": BASE_DIR / "db.sqlite3",
}
}
# Password validation
# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators
@ -103,9 +90,9 @@ AUTH_PASSWORD_VALIDATORS = [
# Internationalization
# https://docs.djangoproject.com/en/4.0/topics/i18n/
LANGUAGE_CODE = "en-us"
LANGUAGE_CODE = "en-gb"
TIME_ZONE = "UTC"
TIME_ZONE = "Europe/London"
USE_I18N = True

View file

@ -1 +1,17 @@
from .base import *
# Database
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": BASE_DIR / "db.sqlite3",
}
}
DEBUG = True
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "django-insecure-lt9sfgmvcrjuiz!=l)3f50x&333&p4wi60t1@jdjtrho43ytl+"

View file

@ -0,0 +1,11 @@
import os
from django.core.exceptions import ImproperlyConfigured
from .base import *
SECRET_KEY = os.environ.get("SECRET_KEY", None)
if not SECRET_KEY:
raise ImproperlyConfigured("Set the SECRET_KEY environment variable")