Switch from memcached to redis

This commit is contained in:
George Lacey 2021-05-18 20:40:44 +01:00
parent c3825efe26
commit d0abc616bf
2 changed files with 9 additions and 4 deletions

View File

@ -120,12 +120,17 @@ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
# cache # cache
CACHES = { CACHES = {
'default': { "default": {
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache', "BACKEND": "django_redis.cache.RedisCache",
'LOCATION': '127.0.0.1:11211', "LOCATION": "redis://127.0.0.1:6379/1",
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient"
},
"KEY_PREFIX": "borgweb"
} }
} }
# security # security
SESSION_COOKIE_SECURE=True SESSION_COOKIE_SECURE=True
SECURE_SSL_REDIRECT=True SECURE_SSL_REDIRECT=True

View File

@ -35,7 +35,7 @@ print_action "Installing pip packages, this may take a while..."
# install required pip packages # install required pip packages
yes | python -m pip install --upgrade wheel yes | python -m pip install --upgrade wheel
yes | python -m pip install django gunicorn django-libsass django-compressor django-axes pymemcache yes | python -m pip install django gunicorn django-libsass django-compressor django-axes django-redis
print_action "Setting up static files and database" print_action "Setting up static files and database"