comparison bns_website/settings/production.py @ 82:0e1f1e8db2a5

For issue #6, add caching to production settings.
author Brian Neal <bgneal@gmail.com>
date Fri, 25 Nov 2011 20:30:48 -0600
parents 6f68f6800843
children 4dca838ae291
comparison
equal deleted inserted replaced
81:4735fdc82b48 82:0e1f1e8db2a5
11 'NAME': 'bravenewsurf', 11 'NAME': 'bravenewsurf',
12 'USER': SECRETS['DB_USER'], 12 'USER': SECRETS['DB_USER'],
13 'PASSWORD': SECRETS['DB_PASSWORD'], 13 'PASSWORD': SECRETS['DB_PASSWORD'],
14 }, 14 },
15 } 15 }
16
17 CACHES = {
18 'default': {
19 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
20 'LOCATION': '127.0.0.1:11211',
21 'TIMEOUT': 600,
22 },
23 }
24
25 CACHE_MIDDLEWARE_ALIAS = 'default'
26 CACHE_MIDDLEWARE_SECONDS = 600
27 CACHE_MIDDLEWARE_KEY_PREFIX = 'BNS'
28 CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
29
30 MIDDLEWARE_CLASSES.insert(0, 'django.middleware.cache.UpdateCacheMiddleware')
31 MIDDLEWARE_CLASSES.append('django.middleware.cache.FetchFromCacheMiddleware')
16 32
17 LOGGING = { 33 LOGGING = {
18 'version': 1, 34 'version': 1,
19 'disable_existing_loggers': True, 35 'disable_existing_loggers': True,
20 'formatters': { 36 'formatters': {