bgneal@34: # Django production settings for the madeira project. bgneal@34: bgneal@34: from settings.base import * bgneal@34: bgneal@34: DEBUG = False bgneal@34: TEMPLATE_DEBUG = DEBUG bgneal@34: bgneal@34: DATABASES = { bgneal@34: 'default': { bgneal@34: 'ENGINE': 'django.db.backends.mysql', bgneal@34: 'NAME': 'madeira_django', bgneal@34: 'USER': SECRETS['DB_USER'], bgneal@34: 'PASSWORD': SECRETS['DB_PASSWORD'], bgneal@34: }, bgneal@34: } bgneal@34: bgneal@34: STATIC_ROOT = os.path.abspath(os.path.join(PROJECT_PATH, '..', 'static_serve')) bgneal@34: bgneal@34: TEMPLATE_LOADERS = [ bgneal@34: ('django.template.loaders.cached.Loader', ( bgneal@34: 'django.template.loaders.filesystem.Loader', bgneal@34: 'django.template.loaders.app_directories.Loader', bgneal@34: )), bgneal@34: ] bgneal@34: bgneal@34: CACHES = { bgneal@34: 'default': { bgneal@34: 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', bgneal@34: 'LOCATION': '127.0.0.1:11211', bgneal@34: 'TIMEOUT': 600, bgneal@34: }, bgneal@34: } bgneal@34: CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True bgneal@34: CACHE_MIDDLEWARE_SECONDS = 600 bgneal@34: CACHE_MIDDLEWARE_KEY_PREFIX = '' bgneal@34: bgneal@34: EMAIL_HOST = 'localhost' bgneal@34: EMAIL_PORT = 25 bgneal@34: bgneal@34: LOGGING = { bgneal@34: 'version': 1, bgneal@34: 'disable_existing_loggers': True, bgneal@34: 'formatters': { bgneal@34: 'verbose': { bgneal@34: 'format': '%(asctime)s %(levelname)s %(module)s %(process)d %(thread)d %(message)s' bgneal@34: }, bgneal@34: 'simple': { bgneal@34: 'format': '%(asctime)s %(levelname)s %(message)s' bgneal@34: }, bgneal@34: }, bgneal@34: 'handlers': { bgneal@34: 'console': { bgneal@34: 'class': 'logging.StreamHandler', bgneal@34: 'level': 'DEBUG', bgneal@34: 'formatter': 'simple', bgneal@34: }, bgneal@34: 'file': { bgneal@34: 'class': 'logging.handlers.RotatingFileHandler', bgneal@34: 'level': 'DEBUG', bgneal@34: 'formatter': 'simple', bgneal@35: 'filename': os.path.join(PROJECT_PATH, 'logs', 'madeira.log'), bgneal@34: 'mode': 'a', bgneal@34: 'maxBytes': 100 * 1024, bgneal@34: 'backupCount': 10, bgneal@34: }, bgneal@34: 'mail_admins': { bgneal@34: 'class': 'django.utils.log.AdminEmailHandler', bgneal@34: 'level': 'ERROR', bgneal@34: 'formatter': 'simple', bgneal@34: }, bgneal@34: }, bgneal@34: 'loggers': { bgneal@34: 'django':{ bgneal@34: 'level': 'WARNING', bgneal@34: 'propagate': False, bgneal@34: 'handlers': ['file'], bgneal@34: }, bgneal@34: 'django.request':{ bgneal@34: 'level': 'ERROR', bgneal@34: 'propagate': True, bgneal@34: 'handlers': ['mail_admins'], bgneal@34: }, bgneal@34: }, bgneal@34: 'root': { bgneal@34: 'level': 'INFO', bgneal@34: 'handlers': ['file'], bgneal@34: }, bgneal@34: }