annotate gpp/settings/local.py @ 571:c2ba9c3395da

For Django 1.4, add a require_debug_false logging filter.
author Brian Neal <bgneal@gmail.com>
date Wed, 02 May 2012 20:43:16 -0500
parents 3fe2eced1be7
children
rev   line source
bgneal@499 1 """
bgneal@499 2 Local Django settings.
bgneal@499 3
bgneal@499 4 """
bgneal@499 5 from settings.base import *
bgneal@499 6
bgneal@499 7 DEBUG = True
bgneal@499 8
bgneal@499 9 DATABASES = {
bgneal@499 10 'default': {
bgneal@499 11 'ENGINE': 'django.db.backends.mysql',
bgneal@569 12 'NAME': SECRETS['DB_NAME'],
bgneal@499 13 'USER': SECRETS['DB_USER'],
bgneal@499 14 'PASSWORD': SECRETS['DB_PASSWORD'],
bgneal@499 15 },
bgneal@499 16 }
bgneal@499 17
bgneal@499 18 # Django Debug Toolbar support
bgneal@499 19 if DEBUG:
bgneal@499 20 try:
bgneal@499 21 import debug_toolbar
bgneal@499 22 except ImportError:
bgneal@499 23 pass
bgneal@499 24 else:
bgneal@499 25 i = MIDDLEWARE_CLASSES.index('django.middleware.common.CommonMiddleware')
bgneal@499 26 MIDDLEWARE_CLASSES.insert(i + 1,
bgneal@499 27 'debug_toolbar.middleware.DebugToolbarMiddleware')
bgneal@499 28 INSTALLED_APPS.append('debug_toolbar')
bgneal@499 29 DEBUG_TOOLBAR_CONFIG = {
bgneal@499 30 'INTERCEPT_REDIRECTS': True,
bgneal@499 31 }
bgneal@499 32
bgneal@499 33 # Logging configuration
bgneal@499 34
bgneal@499 35 LOGGING = {
bgneal@499 36 'version': 1,
bgneal@499 37 'disable_existing_loggers': True,
bgneal@499 38 'formatters': {
bgneal@499 39 'verbose': {
bgneal@499 40 'format': '%(asctime)s %(levelname)s %(module)s %(process)d %(thread)d %(message)s'
bgneal@499 41 },
bgneal@499 42 'simple': {
bgneal@499 43 'format': '%(asctime)s %(levelname)s %(message)s'
bgneal@499 44 },
bgneal@499 45 },
bgneal@571 46 'filters': {
bgneal@571 47 'require_debug_false': {
bgneal@571 48 '()': 'django.utils.log.RequireDebugFalse'
bgneal@571 49 },
bgneal@571 50 },
bgneal@499 51 'handlers': {
bgneal@499 52 'console': {
bgneal@499 53 'class': 'logging.StreamHandler',
bgneal@499 54 'level': 'DEBUG',
bgneal@499 55 'formatter': 'simple',
bgneal@499 56 },
bgneal@499 57 'file': {
bgneal@499 58 'class': 'logging.handlers.RotatingFileHandler',
bgneal@499 59 'level': 'DEBUG',
bgneal@499 60 'formatter': 'simple',
bgneal@499 61 'filename': os.path.join(PROJECT_PATH, 'logs', 'sg101.log'),
bgneal@499 62 'mode': 'a',
bgneal@499 63 'maxBytes': 100 * 1024,
bgneal@499 64 'backupCount': 10,
bgneal@499 65 },
bgneal@499 66 'mail_admins': {
bgneal@499 67 'class': 'django.utils.log.AdminEmailHandler',
bgneal@499 68 'level': 'ERROR',
bgneal@499 69 'formatter': 'simple',
bgneal@571 70 'filters': ['require_debug_false'],
bgneal@499 71 },
bgneal@499 72 },
bgneal@499 73 'loggers': {
bgneal@499 74 'django':{
bgneal@499 75 'level': 'WARNING',
bgneal@499 76 'propagate': False,
bgneal@499 77 'handlers': ['file'],
bgneal@499 78 },
bgneal@499 79 },
bgneal@499 80 'root': {
bgneal@499 81 'level': 'DEBUG',
bgneal@499 82 'handlers': ['file'],
bgneal@499 83 },
bgneal@499 84 }