diff --git a/api/config/settings/common.py b/api/config/settings/common.py index 70804c3c9dd2144783746c7a69596edb75be8350..d71992be1f67a9ce64b409e550a6401f1861af74 100644 --- a/api/config/settings/common.py +++ b/api/config/settings/common.py @@ -260,6 +260,18 @@ BROKER_URL = env("CELERY_BROKER_URL", default='django://') ########## END CELERY +CACHES = { + "default": { + "BACKEND": "django_redis.cache.RedisCache", + "LOCATION": "{0}/{1}".format(env.cache_url('REDIS_URL', default="redis://127.0.0.1:6379"), 0), + "OPTIONS": { + "CLIENT_CLASS": "django_redis.client.DefaultClient", + "IGNORE_EXCEPTIONS": True, # mimics memcache behavior. + # http://niwinz.github.io/django-redis/latest/#_memcached_exceptions_behavior + } + } +} + # Location of root django.contrib.admin URL, use {% url 'admin:index' %} ADMIN_URL = r'^admin/' # Your common stuff: Below this line define 3rd party library settings diff --git a/api/config/settings/local.py b/api/config/settings/local.py index 762ffe7aaf3ccc90a9ac27c6f9db1f35da50ff77..e8108e98bd63bc2fc3b51c111e268b260f258dc6 100644 --- a/api/config/settings/local.py +++ b/api/config/settings/local.py @@ -28,14 +28,6 @@ EMAIL_PORT = 1025 EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND', default='django.core.mail.backends.console.EmailBackend') -# CACHING -# ------------------------------------------------------------------------------ -CACHES = { - 'default': { - 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', - 'LOCATION': '' - } -} # django-debug-toolbar # ------------------------------------------------------------------------------ diff --git a/api/config/settings/production.py b/api/config/settings/production.py index 937328d1f9994817ea598281298214b99d08da2d..e8a05bd3b6c5a34e442480539e39716a3f1baad4 100644 --- a/api/config/settings/production.py +++ b/api/config/settings/production.py @@ -100,17 +100,7 @@ DATABASES['default'] = env.db("DATABASE_URL") # CACHING # ------------------------------------------------------------------------------ # Heroku URL does not pass the DB number, so we parse it in -CACHES = { - "default": { - "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": "{0}/{1}".format(env.cache_url('REDIS_URL', default="redis://127.0.0.1:6379"), 0), - "OPTIONS": { - "CLIENT_CLASS": "django_redis.client.DefaultClient", - "IGNORE_EXCEPTIONS": True, # mimics memcache behavior. - # http://niwinz.github.io/django-redis/latest/#_memcached_exceptions_behavior - } - } -} + # LOGGING CONFIGURATION diff --git a/api/requirements/base.txt b/api/requirements/base.txt index bdf17cf9a6aaa2473fe66bf9a4b93b7ea90697cc..e7bc870cfd85efeff22033e71f583536592b7ab9 100644 --- a/api/requirements/base.txt +++ b/api/requirements/base.txt @@ -55,4 +55,4 @@ mutagen==1.38 # Until this is merged git+https://github.com/EliotBerriot/PyMemoize.git@django -django-dynamic-preferences>=1.2,<1.3 +django-dynamic-preferences>=1.3,<1.4