Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhonas committed Dec 18, 2022
1 parent eb63f4a commit 81ff227
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
38 changes: 19 additions & 19 deletions backend/backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


# NOTE: https://github.com/joke2k/django-environ
import environ
# import environ


# Build paths inside the project like this: BASE_DIR / 'subdir'.
Expand Down Expand Up @@ -88,26 +88,26 @@
# Database
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases

DATABASES = {
'default': dj_database_url.parse(
'postgres://postgres:@127.0.0.1/pear-store'
)
}
# DATABASES = {
# 'default': dj_database_url.parse(
# 'postgres://postgres:@127.0.0.1/pear-store'
# )
# }

# https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-rds.html#python-rds-connect
# import os

# if 'RDS_HOSTNAME' in os.environ:
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.mysql',
# 'NAME': os.environ['RDS_DB_NAME'],
# 'USER': os.environ['RDS_USERNAME'],
# 'PASSWORD': os.environ['RDS_PASSWORD'],
# 'HOST': os.environ['RDS_HOSTNAME'],
# 'PORT': os.environ['RDS_PORT'],
# }
# }
import os

if 'RDS_HOSTNAME' in os.environ:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': os.environ['RDS_DB_NAME'],
'USER': os.environ['RDS_USERNAME'],
'PASSWORD': os.environ['RDS_PASSWORD'],
'HOST': os.environ['RDS_HOSTNAME'],
'PORT': os.environ['RDS_PORT'],
}
}


# Password validation
Expand Down
5 changes: 2 additions & 3 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
asgiref==3.5.2
Django==4.1.3
django-cors-headers==3.13.0
django-environ==0.9.0
djangorestframework==3.14.0
psycopg2==2.9.5
pytz==2022.6
sqlparse==0.4.3
django-cors-headers==3.13.0
dj-database-url==1.0.0
django-environ==0.9.0

0 comments on commit 81ff227

Please sign in to comment.