Mercurial > public > madeira
diff mysite/settings/local.py @ 34:903260593491
Reworking settings.py to a settings package.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Tue, 29 Nov 2011 03:14:25 +0000 |
parents | |
children | b8e166ca993a |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mysite/settings/local.py Tue Nov 29 03:14:25 2011 +0000 @@ -0,0 +1,77 @@ +""" +Local Django settings for The Madeira site. +The contents of this file will vary depending on the local installation. + +""" +from settings.base import * + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', + 'NAME': 'madeira_django1_3', + 'USER': SECRETS['DB_USER'], + 'PASSWORD': SECRETS['DB_PASSWORD'], + }, +} + +# Django Debug Toolbar support +if DEBUG: + try: + import debug_toolbar + except ImportError: + pass + else: + i = MIDDLEWARE_CLASSES.index('django.middleware.common.CommonMiddleware') + MIDDLEWARE_CLASSES.insert(i + 1, + 'debug_toolbar.middleware.DebugToolbarMiddleware') + INSTALLED_APPS.append('debug_toolbar') + DEBUG_TOOLBAR_CONFIG = { + 'INTERCEPT_REDIRECTS': True, + } + +# Logging configuration + +LOGGING = { + 'version': 1, + 'disable_existing_loggers': True, + 'formatters': { + 'verbose': { + 'format': '%(asctime)s %(levelname)s %(module)s %(process)d %(thread)d %(message)s' + }, + 'simple': { + 'format': '%(asctime)s %(levelname)s %(message)s' + }, + }, + 'handlers': { + 'console': { + 'class': 'logging.StreamHandler', + 'level': 'DEBUG', + 'formatter': 'simple', + }, + 'file': { + 'class': 'logging.handlers.RotatingFileHandler', + 'level': 'DEBUG', + 'formatter': 'simple', + 'filename': os.path.join(PROJECT_PATH, 'logs', 'madeira.log'), + 'mode': 'a', + 'maxBytes': 100 * 1024, + 'backupCount': 10, + }, + 'mail_admins': { + 'class': 'django.utils.log.AdminEmailHandler', + 'level': 'ERROR', + 'formatter': 'simple', + }, + }, + 'loggers': { + 'django':{ + 'level': 'WARNING', + 'propagate': False, + 'handlers': ['file'], + }, + }, + 'root': { + 'level': 'DEBUG', + 'handlers': ['file'], + }, +}