annotate mysite/settings/local.py @ 37:c1f3658830e0

Add middleware to support site-wide caching for anonymous users.
author Brian Neal <bgneal@gmail.com>
date Wed, 30 Nov 2011 00:21:51 +0000
parents 903260593491
children b8e166ca993a
rev   line source
bgneal@34 1 """
bgneal@34 2 Local Django settings for The Madeira site.
bgneal@34 3 The contents of this file will vary depending on the local installation.
bgneal@34 4
bgneal@34 5 """
bgneal@34 6 from settings.base import *
bgneal@34 7
bgneal@34 8 DATABASES = {
bgneal@34 9 'default': {
bgneal@34 10 'ENGINE': 'django.db.backends.mysql',
bgneal@34 11 'NAME': 'madeira_django1_3',
bgneal@34 12 'USER': SECRETS['DB_USER'],
bgneal@34 13 'PASSWORD': SECRETS['DB_PASSWORD'],
bgneal@34 14 },
bgneal@34 15 }
bgneal@34 16
bgneal@34 17 # Django Debug Toolbar support
bgneal@34 18 if DEBUG:
bgneal@34 19 try:
bgneal@34 20 import debug_toolbar
bgneal@34 21 except ImportError:
bgneal@34 22 pass
bgneal@34 23 else:
bgneal@34 24 i = MIDDLEWARE_CLASSES.index('django.middleware.common.CommonMiddleware')
bgneal@34 25 MIDDLEWARE_CLASSES.insert(i + 1,
bgneal@34 26 'debug_toolbar.middleware.DebugToolbarMiddleware')
bgneal@34 27 INSTALLED_APPS.append('debug_toolbar')
bgneal@34 28 DEBUG_TOOLBAR_CONFIG = {
bgneal@34 29 'INTERCEPT_REDIRECTS': True,
bgneal@34 30 }
bgneal@34 31
bgneal@34 32 # Logging configuration
bgneal@34 33
bgneal@34 34 LOGGING = {
bgneal@34 35 'version': 1,
bgneal@34 36 'disable_existing_loggers': True,
bgneal@34 37 'formatters': {
bgneal@34 38 'verbose': {
bgneal@34 39 'format': '%(asctime)s %(levelname)s %(module)s %(process)d %(thread)d %(message)s'
bgneal@34 40 },
bgneal@34 41 'simple': {
bgneal@34 42 'format': '%(asctime)s %(levelname)s %(message)s'
bgneal@34 43 },
bgneal@34 44 },
bgneal@34 45 'handlers': {
bgneal@34 46 'console': {
bgneal@34 47 'class': 'logging.StreamHandler',
bgneal@34 48 'level': 'DEBUG',
bgneal@34 49 'formatter': 'simple',
bgneal@34 50 },
bgneal@34 51 'file': {
bgneal@34 52 'class': 'logging.handlers.RotatingFileHandler',
bgneal@34 53 'level': 'DEBUG',
bgneal@34 54 'formatter': 'simple',
bgneal@34 55 'filename': os.path.join(PROJECT_PATH, 'logs', 'madeira.log'),
bgneal@34 56 'mode': 'a',
bgneal@34 57 'maxBytes': 100 * 1024,
bgneal@34 58 'backupCount': 10,
bgneal@34 59 },
bgneal@34 60 'mail_admins': {
bgneal@34 61 'class': 'django.utils.log.AdminEmailHandler',
bgneal@34 62 'level': 'ERROR',
bgneal@34 63 'formatter': 'simple',
bgneal@34 64 },
bgneal@34 65 },
bgneal@34 66 'loggers': {
bgneal@34 67 'django':{
bgneal@34 68 'level': 'WARNING',
bgneal@34 69 'propagate': False,
bgneal@34 70 'handlers': ['file'],
bgneal@34 71 },
bgneal@34 72 },
bgneal@34 73 'root': {
bgneal@34 74 'level': 'DEBUG',
bgneal@34 75 'handlers': ['file'],
bgneal@34 76 },
bgneal@34 77 }