Can't add secrets.py to heroku so environ instead
This commit is contained in:
parent
000d63d49b
commit
f310757764
@ -14,6 +14,17 @@ MANAGERS = ADMINS
|
|||||||
|
|
||||||
PROJECT_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..')
|
PROJECT_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..')
|
||||||
|
|
||||||
|
if os.environ.get('DJANGO_ENV', None) == 'heroku':
|
||||||
|
DATABASES = {
|
||||||
|
'default': {
|
||||||
|
'ENGINE': 'django.db.backends.mysql',
|
||||||
|
'NAME': os.environ.get('DJANGO_DATABASE_NAME'),
|
||||||
|
'USER': os.environ.get('DJANGO_DATABASE_USER'),
|
||||||
|
'PASSWORD': os.environ.get('DJANGO_DATABASE_PASSWORD'),
|
||||||
|
'HOST': os.environ.get('DJANGO_DATABASE_HOST'),
|
||||||
|
'PORT': '', # Set to empty string for default. Not used with sqlite3.
|
||||||
|
}
|
||||||
|
else:
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.mysql',
|
'ENGINE': 'django.db.backends.mysql',
|
||||||
|
Loading…
Reference in New Issue
Block a user