Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug : settings.py 수정 #94

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import os
import sys
from pathlib import Path
# from .mysettings import MY_DATABASES, MY_DATABASE_URL, MY_SECRET
from .mysettings import MY_DATABASES, MY_DATABASE_URL, MY_SECRET
from dotenv import load_dotenv

load_dotenv() # env 파일에 있는 값 얻어오기
Expand All @@ -23,7 +23,7 @@
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/

# SECRET_KEY = MY_SECRET
SECRET_KEY = MY_SECRET

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
Expand Down Expand Up @@ -136,25 +136,25 @@
# Database
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases

# # Neo4j 데이터베이스 설정
# DATABASE_URL = MY_DATABASE_URL
# Neo4j 데이터베이스 설정
DATABASE_URL = MY_DATABASE_URL

# mysql db 연동
DATABASES = MY_DATABASES

# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.mysql',
# 'NAME': os.environ.get('DATABASE_NAME', 'default_db_name'),
# 'USER': os.environ.get('DATABASE_USER', 'default_user'),
# 'PASSWORD': os.environ.get('DATABASE_PASSWORD', 'default_password'),
# 'HOST': os.environ.get('DATABASE_HOST', 'localhost'),
# 'PORT': os.environ.get('DATABASE_PORT', '3306'),
# }
# }
#
# # mysql db 연동
# DATABASES = MY_DATABASES

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': os.environ.get('DATABASE_NAME', 'default_db_name'),
'USER': os.environ.get('DATABASE_USER', 'default_user'),
'PASSWORD': os.environ.get('DATABASE_PASSWORD', 'default_password'),
'HOST': os.environ.get('DATABASE_HOST', 'localhost'),
'PORT': os.environ.get('DATABASE_PORT', '3306'),
}
}

DATABASE_URL = os.environ.get('DATABASE_URL', "default_database_url")
SECRET_KEY = os.environ.get('SECRET_KEY', 'default_secret_key')
# DATABASE_URL = os.environ.get('DATABASE_URL', "default_database_url")
# SECRET_KEY = os.environ.get('SECRET_KEY', 'default_secret_key')

# Password validation
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
Expand Down