Skip to content

Commit

Permalink
bug: settings.py 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jungeunyooon committed Jan 25, 2024
1 parent 2ad7e14 commit 9b4fc8e
Showing 1 changed file with 20 additions and 24 deletions.
44 changes: 20 additions & 24 deletions backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
import os
import sys
from pathlib import Path

# sys.path.append(os.path.join(os.path.dirname(__file__), 'backend'))
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 @@ -25,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 @@ -138,25 +136,25 @@
# Database
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases

# 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'),
# }
# }
# # Neo4j 데이터베이스 설정
# DATABASE_URL = MY_DATABASE_URL
#
# DATABASE_URL = os.environ.get('DATABASE_URL', "default_database_url")
# SECRET_KEY = os.environ.get('SECRET_KEY', 'default_secret_key')
# # mysql db 연동
# DATABASES = MY_DATABASES

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

DATABASE_URL = os.environ.get('DATABASE_URL')
SECRET_KEY = os.environ.get('SECRET_KEY')

# Password validation
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
Expand Down Expand Up @@ -228,6 +226,4 @@
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
MEDIA_URL = f'https://{AWS_S3_CUSTOM_DOMAIN}/'

#정적 파일 불러오기
STATIC_URL = 'static/'
STATIC_ROOT = os.path.join(BASE_DIR, '_static')

0 comments on commit 9b4fc8e

Please sign in to comment.