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