Skip to content

Instantly share code, notes, and snippets.

@joncotton
Created February 6, 2013 00:39
Show Gist options
  • Select an option

  • Save joncotton/4719183 to your computer and use it in GitHub Desktop.

Select an option

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.
# 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