Skip to content

Commit 09fd5d1

Browse files
Merge pull request #136 from jarifibrahim/heroku-dev-fix
settings.py: Add database settings for heroku
2 parents bad80c8 + 6d57600 commit 09fd5d1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

oshc/oshc/settings.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
1212
import os
13+
import dj_database_url
1314

1415
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
1516

@@ -84,6 +85,11 @@
8485
}
8586
}
8687

88+
# Get DATABASE_URL environment variable and update default DATABASE settings
89+
# This setting is required for Heroku
90+
db_from_env = dj_database_url.config()
91+
DATABASES['default'].update(db_from_env)
92+
8793
# Internationalization
8894
# https://docs.djangoproject.com/en/1.7/topics/i18n/
8995

0 commit comments

Comments
 (0)