bgneal@499
|
1 """
|
bgneal@499
|
2 Production Django settings.
|
bgneal@499
|
3
|
bgneal@499
|
4 """
|
bgneal@499
|
5 from settings.base import *
|
bgneal@499
|
6
|
bgneal@499
|
7 DEBUG = False
|
bgneal@499
|
8
|
bgneal@499
|
9 DATABASES = {
|
bgneal@499
|
10 'default': {
|
bgneal@499
|
11 'ENGINE': 'django.db.backends.mysql',
|
bgneal@499
|
12 'NAME': 'gremmies_portal',
|
bgneal@499
|
13 'USER': SECRETS['DB_USER'],
|
bgneal@499
|
14 'PASSWORD': SECRETS['DB_PASSWORD'],
|
bgneal@499
|
15 },
|
bgneal@499
|
16 }
|
bgneal@499
|
17
|
bgneal@499
|
18 STATIC_ROOT = os.path.abspath(os.path.join(PROJECT_PATH, '..', 'static_serve'))
|
bgneal@499
|
19
|
bgneal@499
|
20 # Used cached template loader
|
bgneal@499
|
21 TEMPLATE_LOADERS = [
|
bgneal@499
|
22 ('django.template.loaders.cached.Loader', (
|
bgneal@499
|
23 'django.template.loaders.filesystem.Loader',
|
bgneal@499
|
24 'django.template.loaders.app_directories.Loader',
|
bgneal@499
|
25 )),
|
bgneal@499
|
26 ]
|
bgneal@499
|
27
|
bgneal@499
|
28 CACHES = {
|
bgneal@499
|
29 'default': {
|
bgneal@499
|
30 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
|
bgneal@499
|
31 'LOCATION': '127.0.0.1:11211',
|
bgneal@499
|
32 'TIMEOUT': 600,
|
bgneal@499
|
33 },
|
bgneal@499
|
34 }
|
bgneal@499
|
35 CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
|
bgneal@499
|
36 CACHE_MIDDLEWARE_SECONDS = 600
|
bgneal@499
|
37 CACHE_MIDDLEWARE_KEY_PREFIX = ''
|
bgneal@499
|
38
|
bgneal@499
|
39 EMAIL_HOST = 'localhost'
|
bgneal@499
|
40 EMAIL_PORT = 25
|
bgneal@512
|
41 EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
bgneal@499
|
42
|
bgneal@499
|
43 DONATIONS_DEBUG = False
|
bgneal@499
|
44
|
bgneal@499
|
45 # Logging configuration
|
bgneal@499
|
46
|
bgneal@499
|
47 LOGGING = {
|
bgneal@499
|
48 'version': 1,
|
bgneal@499
|
49 'disable_existing_loggers': True,
|
bgneal@499
|
50 'formatters': {
|
bgneal@499
|
51 'verbose': {
|
bgneal@499
|
52 'format': '%(asctime)s %(levelname)s %(module)s %(process)d %(thread)d %(message)s'
|
bgneal@499
|
53 },
|
bgneal@499
|
54 'simple': {
|
bgneal@499
|
55 'format': '%(asctime)s %(levelname)s %(message)s'
|
bgneal@499
|
56 },
|
bgneal@499
|
57 },
|
bgneal@571
|
58 'filters': {
|
bgneal@571
|
59 'require_debug_false': {
|
bgneal@571
|
60 '()': 'django.utils.log.RequireDebugFalse'
|
bgneal@571
|
61 },
|
bgneal@571
|
62 },
|
bgneal@499
|
63 'handlers': {
|
bgneal@499
|
64 'console': {
|
bgneal@499
|
65 'class': 'logging.StreamHandler',
|
bgneal@499
|
66 'level': 'DEBUG',
|
bgneal@499
|
67 'formatter': 'simple',
|
bgneal@499
|
68 },
|
bgneal@499
|
69 'file': {
|
bgneal@499
|
70 'class': 'logging.handlers.RotatingFileHandler',
|
bgneal@499
|
71 'level': 'DEBUG',
|
bgneal@499
|
72 'formatter': 'simple',
|
bgneal@499
|
73 'filename': os.path.join(PROJECT_PATH, 'logs', 'sg101.log'),
|
bgneal@499
|
74 'mode': 'a',
|
bgneal@499
|
75 'maxBytes': 100 * 1024,
|
bgneal@499
|
76 'backupCount': 10,
|
bgneal@499
|
77 },
|
bgneal@499
|
78 'mail_admins': {
|
bgneal@499
|
79 'class': 'django.utils.log.AdminEmailHandler',
|
bgneal@499
|
80 'level': 'ERROR',
|
bgneal@499
|
81 'formatter': 'simple',
|
bgneal@571
|
82 'filters': ['require_debug_false'],
|
bgneal@499
|
83 },
|
bgneal@499
|
84 },
|
bgneal@499
|
85 'loggers': {
|
bgneal@499
|
86 'django':{
|
bgneal@499
|
87 'level': 'WARNING',
|
bgneal@499
|
88 'propagate': False,
|
bgneal@499
|
89 'handlers': ['file'],
|
bgneal@499
|
90 },
|
bgneal@499
|
91 'django.request':{
|
bgneal@499
|
92 'level': 'ERROR',
|
bgneal@499
|
93 'propagate': True,
|
bgneal@499
|
94 'handlers': ['mail_admins'],
|
bgneal@499
|
95 },
|
bgneal@499
|
96 },
|
bgneal@499
|
97 'root': {
|
bgneal@499
|
98 'level': 'INFO',
|
bgneal@499
|
99 'handlers': ['file'],
|
bgneal@499
|
100 },
|
bgneal@499
|
101 }
|