Created
October 10, 2013 13:32
-
-
Save jamesrwhite/6918370 to your computer and use it in GitHub Desktop.
Switching Django configs on Google App Engine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Database configs, only one of those will be chosen based on the env | |
database_configs = { | |
'development': { | |
'ENGINE': 'django.db.backends.mysql', | |
'NAME': 'wina', | |
'USER': 'django', | |
'PASSWORD': 'password', | |
'HOST': '127.0.0.1', | |
'PORT': '3306', | |
}, | |
'production': { | |
'ENGINE': 'django.db.backends.mysql', | |
'NAME': '', | |
'USER': '', | |
'PASSWORD': '', | |
'HOST': '', | |
'PORT': '', | |
} | |
} | |
DATABASES = { | |
'default': database_configs['production'] if os.getenv('SERVER_SOFTWARE') and os.getenv('SERVER_SOFTWARE').startswith('Google App Engine/') else database_configs['development'] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment