Commit 163f6cd3 authored by JP Layacan's avatar JP Layacan

Configured settings.py to safely store the secret key in a .env file

parent ba0b4bec
Pipeline #2241 failed with stages
SECRET_KEY='django-insecure-!#35*x&fl+k@d*hai6n%_q75k6qqwui#67#)da%xh%m6+xo&vd'
...@@ -11,6 +11,11 @@ https://docs.djangoproject.com/en/3.2/ref/settings/ ...@@ -11,6 +11,11 @@ https://docs.djangoproject.com/en/3.2/ref/settings/
""" """
from pathlib import Path from pathlib import Path
from dotenv import load_dotenv
import os
load_dotenv()
# Build paths inside the project like this: BASE_DIR / 'subdir'. # Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent BASE_DIR = Path(__file__).resolve().parent.parent
...@@ -20,7 +25,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent ...@@ -20,7 +25,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret! # SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-!#35*x&fl+k@d*hai6n%_q75k6qqwui#67#)da%xh%m6+xo&vd' SECRET_KEY = os.getenv('SECRET_KEY')
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment