Enable memcache caching

This commit is contained in:
Oliver Falk
2019-02-18 16:40:44 +01:00
parent 7cb39f86dd
commit a19a837e82
2 changed files with 14 additions and 0 deletions

View File

@@ -28,10 +28,14 @@ INSTALLED_APPS.extend([
MIDDLEWARE.extend([
'django.middleware.locale.LocaleMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
])
MIDDLEWARE.insert(
0, 'ivatar.middleware.MultipleProxyMiddleware',
)
MIDDLEWARE.insert(
1, 'django.middleware.cache.UpdateCacheMiddleware',
)
AUTHENTICATION_BACKENDS = (
# Enable this to allow LDAP authentication.
@@ -175,3 +179,12 @@ MESSAGE_TAGS = {
message_constants.WARNING: 'warning',
message_constants.ERROR: 'danger',
}
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': [
'127.0.0.1:11211',
],
}
}

View File

@@ -35,3 +35,4 @@ notsetuptools
git+https://github.com/ofalk/monsterid.git
git+https://github.com/azaghal/pydenticon.git
git+https://github.com/ofalk/Robohash.git@devel
python-memcached