Skip to content

Commit 033e4c5

Browse files
committed
aws config
1 parent 4cabbcb commit 033e4c5

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ __pycache__
55
myvenv
66
db.sqlite3
77
/static
8-
.DS_Store
8+
.DS_Store
9+
# Elastic Beanstalk Files
10+
.elasticbeanstalk/*
11+
!.elasticbeanstalk/*.cfg.yml
12+
!.elasticbeanstalk/*.global.yml

screencast/settings.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,29 @@
105105
#'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
106106
# }
107107
#}
108-
109-
DATABASES = { # GALAXYZPJ'S LOCAL INSTANCE
108+
if 'RDS_DB_NAME' in os.environ:
109+
DATABASES = {
110+
'default': {
111+
'ENGINE': 'django.db.backends.postgresql_psycopg2',
112+
'NAME': os.environ['RDS_DB_NAME'],
113+
'USER': os.environ['RDS_USERNAME'],
114+
'PASSWORD': os.environ['RDS_PASSWORD'],
115+
'HOST': os.environ['RDS_HOSTNAME'],
116+
'PORT': os.environ['RDS_PORT'],
117+
}
118+
}
119+
else :
120+
DATABASES = { # GALAXYZPJ'S LOCAL INSTANCE
110121
'default': {
111122
'ENGINE': 'django.db.backends.postgresql',
112123
'NAME': 'postgres',
113124
'USER': 'postgres',
114-
'PASSWORD': 'ramiz',
115-
'HOST': 'localhost',
125+
'PASSWORD': 'postgres',
126+
'HOST': 'postgres',
116127
'PORT': '5432',
117128
}
118129
}
119-
#DATABASES = {
130+
#DATABpippiASES = {
120131
# 'default': {
121132
# 'ENGINE': 'django.db.backends.postgresql_psycopg2',
122133
# 'NAME': 'd8s04nkvqhp0h4',

0 commit comments

Comments
 (0)