annotate mysite/settings/production.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 21172e9be136
rev   line source
bgneal@34 1 # Django production settings for the madeira project.
bgneal@34 2
bgneal@34 3 from settings.base import *
bgneal@34 4
bgneal@34 5 DEBUG = False
bgneal@34 6 TEMPLATE_DEBUG = DEBUG
bgneal@34 7
bgneal@34 8 DATABASES = {
bgneal@34 9 'default': {
bgneal@34 10 'ENGINE': 'django.db.backends.mysql',
bgneal@34 11 'NAME': 'madeira_django',
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 STATIC_ROOT = os.path.abspath(os.path.join(PROJECT_PATH, '..', 'static_serve'))
bgneal@34 18
bgneal@34 19 TEMPLATE_LOADERS = [
bgneal@34 20 ('django.template.loaders.cached.Loader', (
bgneal@34 21 'django.template.loaders.filesystem.Loader',
bgneal@34 22 'django.template.loaders.app_directories.Loader',
bgneal@34 23 )),
bgneal@34 24 ]
bgneal@34 25
bgneal@34 26 CACHES = {
bgneal@34 27 'default': {
bgneal@34 28 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
bgneal@34 29 'LOCATION': '127.0.0.1:11211',
bgneal@34 30 'TIMEOUT': 600,
bgneal@34 31 },
bgneal@34 32 }
bgneal@34 33 CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
bgneal@34 34 CACHE_MIDDLEWARE_SECONDS = 600
bgneal@34 35 CACHE_MIDDLEWARE_KEY_PREFIX = ''
bgneal@34 36
bgneal@34 37 EMAIL_HOST = 'localhost'
bgneal@34 38 EMAIL_PORT = 25
bgneal@34 39
bgneal@34 40 LOGGING = {
bgneal@34 41 'version': 1,
bgneal@34 42 'disable_existing_loggers': True,
bgneal@34 43 'formatters': {
bgneal@34 44 'verbose': {
bgneal@34 45 'format': '%(asctime)s %(levelname)s %(module)s %(process)d %(thread)d %(message)s'
bgneal@34 46 },
bgneal@34 47 'simple': {
bgneal@34 48 'format': '%(asctime)s %(levelname)s %(message)s'
bgneal@34 49 },
bgneal@34 50 },
bgneal@34 51 'handlers': {
bgneal@34 52 'console': {
bgneal@34 53 'class': 'logging.StreamHandler',
bgneal@34 54 'level': 'DEBUG',
bgneal@34 55 'formatter': 'simple',
bgneal@34 56 },
bgneal@34 57 'file': {
bgneal@34 58 'class': 'logging.handlers.RotatingFileHandler',
bgneal@34 59 'level': 'DEBUG',
bgneal@34 60 'formatter': 'simple',
bgneal@34 61 'filename': os.path.join(project_path, 'logs', 'madeira.log'),
bgneal@34 62 'mode': 'a',
bgneal@34 63 'maxBytes': 100 * 1024,
bgneal@34 64 'backupCount': 10,
bgneal@34 65 },
bgneal@34 66 'mail_admins': {
bgneal@34 67 'class': 'django.utils.log.AdminEmailHandler',
bgneal@34 68 'level': 'ERROR',
bgneal@34 69 'formatter': 'simple',
bgneal@34 70 },
bgneal@34 71 },
bgneal@34 72 'loggers': {
bgneal@34 73 'django':{
bgneal@34 74 'level': 'WARNING',
bgneal@34 75 'propagate': False,
bgneal@34 76 'handlers': ['file'],
bgneal@34 77 },
bgneal@34 78 'django.request':{
bgneal@34 79 'level': 'ERROR',
bgneal@34 80 'propagate': True,
bgneal@34 81 'handlers': ['mail_admins'],
bgneal@34 82 },
bgneal@34 83 },
bgneal@34 84 'root': {
bgneal@34 85 'level': 'INFO',
bgneal@34 86 'handlers': ['file'],
bgneal@34 87 },
bgneal@34 88 }