Created
February 6, 2013 00:39
-
-
Save joncotton/4719183 to your computer and use it in GitHub Desktop.
I specify my Django database settings in `local_settings.py` and I use this to yell at me if I switch to the production database.
This file contains hidden or 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
| # actual database config | |
| DATABASES = { | |
| 'default': local | |
| # 'default': PRODUCTION | |
| } | |
| if DATABASES['default'] == PRODUCTION: | |
| import warnings | |
| from django.utils.termcolors import colorize | |
| warnings.warn(colorize("PRODUCTION DATABASE!!", fg="red", opts=['blink'])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment