feat: local_settings to store secrets
This commit is contained in:
parent
33e9d830f8
commit
d1cb6b1b95
4 changed files with 40 additions and 0 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -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
|
||||
|
|
0
sso/local_settings/__init__.py
Normal file
0
sso/local_settings/__init__.py
Normal file
30
sso/local_settings/local_settings.example.py
Normal file
30
sso/local_settings/local_settings.example.py
Normal 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")
|
|
@ -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
|
||||
|
|
Reference in a new issue