사물인식 팀 프로젝트 장고부분 댓글CRUD
git에 장고 프로젝트를 올려두었는데 사진과 같은 내용의 메일이 왔다
django 공식문서
SECRET_KEY 란 특정 django 설치을 위한 비밀 키이며 이는 암호화 서명을 제공하는 데 사용되며 고유하고 예측할 수 없는 값으로 설정해야 한다. "라고 나와 있다. 즉, 암호화 인증에 사용되는 비밀키라는 말이다. - (보안 관리)
{
"SECRET_KEY": "django-insecure-x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
import os, json
from django.core.exceptions import ImproperlyConfigured
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
secret_file = os.path.join(BASE_DIR, 'secrets.json')
with open(secret_file) as f:
secrets = json.loads(f.read())
def get_secret(setting):
try:
return secrets[setting]
except KeyError:
error_msg = "Set the {} environment variable".format(setting)
raise ImproperlyConfigured(error_msg)
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = get_secret("SECRET_KEY")
## Django Secret
secrets.json