bgneal@26: # Django production settings for bns_website project. bgneal@26: bgneal@26: from settings.base import * bgneal@26: bgneal@26: DEBUG = False bgneal@26: TEMPLATE_DEBUG = DEBUG bgneal@26: bgneal@101: ALLOWED_HOSTS = ['.bravenewsurf.com'] bgneal@101: bgneal@26: DATABASES = { bgneal@26: 'default': { bgneal@26: 'ENGINE': 'django.db.backends.mysql', bgneal@26: 'NAME': 'bravenewsurf', bgneal@26: 'USER': SECRETS['DB_USER'], bgneal@26: 'PASSWORD': SECRETS['DB_PASSWORD'], bgneal@26: }, bgneal@26: } bgneal@26: bgneal@92: TEMPLATE_LOADERS = [ bgneal@92: ('django.template.loaders.cached.Loader', ( bgneal@92: 'django.template.loaders.filesystem.Loader', bgneal@92: 'django.template.loaders.app_directories.Loader', bgneal@92: )), bgneal@92: ] bgneal@92: bgneal@82: CACHES = { bgneal@82: 'default': { bgneal@82: 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', bgneal@82: 'LOCATION': '127.0.0.1:11211', bgneal@82: 'TIMEOUT': 600, bgneal@82: }, bgneal@82: } bgneal@82: bgneal@82: CACHE_MIDDLEWARE_ALIAS = 'default' bgneal@82: CACHE_MIDDLEWARE_SECONDS = 600 bgneal@82: CACHE_MIDDLEWARE_KEY_PREFIX = 'BNS' bgneal@82: CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True bgneal@82: bgneal@82: MIDDLEWARE_CLASSES.insert(0, 'django.middleware.cache.UpdateCacheMiddleware') bgneal@82: MIDDLEWARE_CLASSES.append('django.middleware.cache.FetchFromCacheMiddleware') bgneal@82: bgneal@26: LOGGING = { bgneal@26: 'version': 1, bgneal@26: 'disable_existing_loggers': True, bgneal@26: 'formatters': { bgneal@26: 'verbose': { bgneal@26: 'format': '%(asctime)s %(levelname)s %(module)s %(process)d %(thread)d %(message)s' bgneal@26: }, bgneal@26: 'simple': { bgneal@26: 'format': '%(asctime)s %(levelname)s %(message)s' bgneal@26: }, bgneal@26: }, bgneal@26: 'handlers': { bgneal@26: 'console': { bgneal@26: 'class': 'logging.StreamHandler', bgneal@26: 'level': 'DEBUG', bgneal@26: 'formatter': 'simple', bgneal@26: }, bgneal@26: 'file': { bgneal@26: 'class': 'logging.handlers.RotatingFileHandler', bgneal@26: 'level': 'DEBUG', bgneal@26: 'formatter': 'simple', bgneal@26: 'filename': os.path.join(PROJECT_PATH, 'logs', 'bns.log'), bgneal@26: 'mode': 'a', bgneal@26: 'maxBytes': 100 * 1024, bgneal@26: 'backupCount': 10, bgneal@26: }, bgneal@26: 'mail_admins': { bgneal@26: 'class': 'django.utils.log.AdminEmailHandler', bgneal@26: 'level': 'ERROR', bgneal@26: 'formatter': 'simple', bgneal@26: }, bgneal@26: }, bgneal@26: 'loggers': { bgneal@26: 'django':{ bgneal@26: 'level': 'ERROR', bgneal@26: 'propagate': False, bgneal@26: 'handlers': ['file'], bgneal@26: }, bgneal@26: }, bgneal@26: 'root': { bgneal@26: 'level': 'DEBUG', bgneal@26: 'handlers': ['file'], bgneal@26: }, bgneal@26: }