diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 95b03f054a6158e630c4ee94b3854dc62e043684..5a20caf47b9698349a20ce69cffbc7bb4342e111 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,7 +34,7 @@ before_script: DJANGO_SETTINGS_MODULE: "config.settings.container.dev" DJANGO_TWILIO_ACCOUNT_SID: "fake_sid" DJANGO_TWILIO_AUTH_TOKEN: "fake_token" - DJANGO_AWS_ELASTICACHE_ADDR: "local_host:80" + DJANGO_AWS_ELASTICACHE_ADDR: "fake_server:80" LVALERT_OVERSEER_PORT: "2" LVALERT_SERVER: "fake_server" LVALERT_USER: "fake_user" diff --git a/config/settings/container/base.py b/config/settings/container/base.py index f6245b9cbc8dc25c978e5dd59650befa1163fd31..a23bed465b57e56edf0e59d9844b83ee918f040c 100644 --- a/config/settings/container/base.py +++ b/config/settings/container/base.py @@ -86,13 +86,26 @@ ALERT_EMAIL_FROM = get_from_env('DJANGO_ALERT_EMAIL_FROM') # AWS Elasticache settings: AWS_ELASTICACHE_ADDR = get_from_env('DJANGO_AWS_ELASTICACHE_ADDR') -CACHES['default'] = { - 'BACKEND': 'django_elasticache.memcached.ElastiCache', +#CACHES['default'] = { +# 'BACKEND': 'django_elasticache.memcached.ElastiCache', +# 'LOCATION': AWS_ELASTICACHE_ADDR, +# 'OPTIONS': { +# 'IGNORE_CLUSTER_ERRORS': True, +# }, +# } + +CACHES = { + 'default': { + 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', 'LOCATION': AWS_ELASTICACHE_ADDR, - 'OPTIONS': { - 'IGNORE_CLUSTER_ERRORS': True, - }, - } + }, + # For API throttles + 'throttles': { + 'BACKEND': 'django.core.cache.backends.db.DatabaseCache', + 'LOCATION': 'api_throttle_cache', # Table name + }, +} + MIDDLEWARE = [ 'core.middleware.maintenance.MaintenanceModeMiddleware', 'events.middleware.PerformanceMiddleware', diff --git a/requirements.txt b/requirements.txt index 7e3117bdf7d47e6d8c1340deed4050918f13def6..82001af7d1466f0895ac39f35e17700b2cef5c03 100644 --- a/requirements.txt +++ b/requirements.txt @@ -32,7 +32,7 @@ phonenumbers==8.8.11 python-ldap==3.1.0 python-memcached==1.59 # Install django-elasticache along with python memcached: -git+git://github.com/gusdan/django-elasticache.git#egg=django-elasticache +#git+git://github.com/gusdan/django-elasticache.git#egg=django-elasticache scipy==1.2.1 sentry-sdk==0.7.10 service_identity==17.0.0