From b7d8286895b638edeadc747832b90fef033ab217 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Thu, 15 Oct 2020 13:51:01 +0100 Subject: [PATCH] Use database caching --- bakerydemo/settings/production.py | 7 +++++++ heroku.yml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bakerydemo/settings/production.py b/bakerydemo/settings/production.py index 7676413..f1240df 100644 --- a/bakerydemo/settings/production.py +++ b/bakerydemo/settings/production.py @@ -93,6 +93,13 @@ if ELASTICSEARCH_ENDPOINT: aws_service='es', ) +CACHES = { + 'default': { + 'BACKEND': 'django.core.cache.backends.db.DatabaseCache', + 'LOCATION': 'django_cache', + } +} + # Simplified static file serving. # https://warehouse.python.org/project/whitenoise/ diff --git a/heroku.yml b/heroku.yml index 8ffc51f..f4f8617 100644 --- a/heroku.yml +++ b/heroku.yml @@ -4,4 +4,4 @@ build: release: image: web command: - - django-admin migrate --noinput + - django-admin createcachetable && django-admin migrate --noinput