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