comparison gpp/settings/production.py @ 499:1a09a7bea000

For #236, switch to a settings package scheme.
author Brian Neal <bgneal@gmail.com>
date Wed, 30 Nov 2011 02:41:18 +0000
parents
children 5794e3414596
comparison
equal deleted inserted replaced
498:b137a0966e4b 499:1a09a7bea000
1 """
2 Production Django settings.
3
4 """
5 from settings.base import *
6
7 DEBUG = False
8
9 DATABASES = {
10 'default': {
11 'ENGINE': 'django.db.backends.mysql',
12 'NAME': 'gremmies_portal',
13 'USER': SECRETS['DB_USER'],
14 'PASSWORD': SECRETS['DB_PASSWORD'],
15 },
16 }
17
18 # Path to elsewhere application static images
19 STATICFILES_DIRS.append(('elsewhere',
20 '/home/var/django-sites/sg101/3rdparty/elsewhere/img'))
21
22 STATIC_ROOT = os.path.abspath(os.path.join(PROJECT_PATH, '..', 'static_serve'))
23
24 # Used cached template loader
25 TEMPLATE_LOADERS = [
26 ('django.template.loaders.cached.Loader', (
27 'django.template.loaders.filesystem.Loader',
28 'django.template.loaders.app_directories.Loader',
29 )),
30 ]
31
32 CACHES = {
33 'default': {
34 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
35 'LOCATION': '127.0.0.1:11211',
36 'TIMEOUT': 600,
37 },
38 }
39 CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
40 CACHE_MIDDLEWARE_SECONDS = 600
41 CACHE_MIDDLEWARE_KEY_PREFIX = ''
42
43 EMAIL_HOST = 'localhost'
44 EMAIL_PORT = 25
45
46 GPP_SEND_EMAIL = True
47 DONATIONS_DEBUG = False
48
49 # Logging configuration
50
51 LOGGING = {
52 'version': 1,
53 'disable_existing_loggers': True,
54 'formatters': {
55 'verbose': {
56 'format': '%(asctime)s %(levelname)s %(module)s %(process)d %(thread)d %(message)s'
57 },
58 'simple': {
59 'format': '%(asctime)s %(levelname)s %(message)s'
60 },
61 },
62 'handlers': {
63 'console': {
64 'class': 'logging.StreamHandler',
65 'level': 'DEBUG',
66 'formatter': 'simple',
67 },
68 'file': {
69 'class': 'logging.handlers.RotatingFileHandler',
70 'level': 'DEBUG',
71 'formatter': 'simple',
72 'filename': os.path.join(PROJECT_PATH, 'logs', 'sg101.log'),
73 'mode': 'a',
74 'maxBytes': 100 * 1024,
75 'backupCount': 10,
76 },
77 'mail_admins': {
78 'class': 'django.utils.log.AdminEmailHandler',
79 'level': 'ERROR',
80 'formatter': 'simple',
81 },
82 },
83 'loggers': {
84 'django':{
85 'level': 'WARNING',
86 'propagate': False,
87 'handlers': ['file'],
88 },
89 'django.request':{
90 'level': 'ERROR',
91 'propagate': True,
92 'handlers': ['mail_admins'],
93 },
94 },
95 'root': {
96 'level': 'INFO',
97 'handlers': ['file'],
98 },
99 }