feat: local_settings to store secrets

This commit is contained in:
Aravinth Manivannan 2022-08-22 17:23:40 +05:30
parent 33e9d830f8
commit d1cb6b1b95
Signed by untrusted user: realaravinth
GPG key ID: AD9F0F08E855ED88
4 changed files with 40 additions and 0 deletions

2
.gitignore vendored
View file

@ -158,3 +158,5 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
sso/local_settings.py
sso/local_settings/local_settings.py

View file

View file

@ -0,0 +1,30 @@
"""
Django settings for dashboard project.
Generated by 'django-admin startproject' using Django 4.0.3.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/settings/
"""
import environ
import os
env = environ.Env()
# 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!
# A new SECRET_KEY can be generated by running the following command:
# openssl rand -hex 32
SECRET_KEY = "django-insecure-44zt@)$td7_yh(01q^hrce%h(311n!djn%%#s1b7$cvfy!pf7y"
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
print("Finished importing local_settings.ci.py")

View file

@ -135,3 +135,11 @@ OAUTH2_PROVIDER = {
"openid": "OpenID Connect scope",
},
}
try:
from .local_settings.local_settings import *
print("Found local_settings")
except ModuleNotFoundError:
print("No local_settings available, using defaults")
pass