diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mysite/settings/production.py	Tue Nov 29 03:14:25 2011 +0000
@@ -0,0 +1,88 @@
+# Django production settings for the madeira project.
+
+from settings.base import *
+
+DEBUG = False
+TEMPLATE_DEBUG = DEBUG
+
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.mysql',
+        'NAME': 'madeira_django',
+        'USER': SECRETS['DB_USER'],
+        'PASSWORD': SECRETS['DB_PASSWORD'],
+    },
+}
+
+STATIC_ROOT = os.path.abspath(os.path.join(PROJECT_PATH, '..', 'static_serve'))
+
+TEMPLATE_LOADERS = [
+    ('django.template.loaders.cached.Loader', (
+        'django.template.loaders.filesystem.Loader',
+        'django.template.loaders.app_directories.Loader',
+    )),
+]
+
+CACHES = {
+    'default': {
+        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
+        'LOCATION': '127.0.0.1:11211',
+        'TIMEOUT': 600,
+    },
+}
+CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
+CACHE_MIDDLEWARE_SECONDS = 600
+CACHE_MIDDLEWARE_KEY_PREFIX = ''
+
+EMAIL_HOST = 'localhost'
+EMAIL_PORT = 25
+
+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'],
+        },
+        'django.request':{
+            'level': 'ERROR',
+            'propagate': True,
+            'handlers': ['mail_admins'],
+        },
+    },
+    'root': {
+        'level': 'INFO',
+        'handlers': ['file'],
+    },
+}