Use same CACHES/SESSION_ENGINE settings in dev as in prod.

(imported from commit d45ec576bd0a87b9da0c1a7f7e0a002091d728ff)
This commit is contained in:
Steve Howell 2013-07-02 17:29:00 -04:00
parent 009d7b8174
commit edc718951c
2 changed files with 27 additions and 42 deletions

View File

@ -405,36 +405,27 @@ USING_RABBITMQ = DEPLOYED
# This password also appears in servers/configure-rabbitmq
RABBITMQ_PASSWORD = 'xxxxxxxxxxxxxxxx'
# Caching
if DEPLOYED:
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
'LOCATION': '127.0.0.1:11211',
'TIMEOUT': 3600
},
}
SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"
else:
CACHES = { 'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOCATION': 'humbug-default-local-cache',
'TIMEOUT': 3600,
SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
'LOCATION': '127.0.0.1:11211',
'TIMEOUT': 3600
},
'database': {
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
'LOCATION': 'third_party_api_results',
# Basically never timeout. Setting to 0 isn't guaranteed
# to work, see https://code.djangoproject.com/ticket/9595
'TIMEOUT': 2000000000,
'OPTIONS': {
'MAX_ENTRIES': 100000
}
} }
CACHES['database'] = {
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
'LOCATION': 'third_party_api_results',
# Basically never timeout. Setting to 0 isn't guaranteed
# to work, see https://code.djangoproject.com/ticket/9595
'TIMEOUT': 2000000000,
'OPTIONS': {
'MAX_ENTRIES': 100000000,
'CULL_FREQUENCY': 10,
},
'MAX_ENTRIES': 100000000,
'CULL_FREQUENCY': 10,
}
},
}
if DEPLOYED:
SERVER_LOG_PATH = "/home/humbug/logs/server.log"

View File

@ -37,19 +37,13 @@ USING_RABBITMQ = False
TUTORIAL_ENABLED = False
# Disable use of memcached for caching
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
'LOCATION': '127.0.0.1:11211',
'TIMEOUT': 3600
},
'database': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
'LOCATION': 'humbug-database-test-cache',
'TIMEOUT': 3600,
'OPTIONS': {
'MAX_ENTRIES': 100000
},
} }
CACHES['database'] = {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
'LOCATION': 'humbug-database-test-cache',
'TIMEOUT': 3600,
'OPTIONS': {
'MAX_ENTRIES': 100000
}
}
LOGGING['loggers']['humbug.requests']['level'] = 'CRITICAL'