Skip to content

Commit f1df863

Browse files
committed
use redis as django cache
1 parent bb8799b commit f1df863

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

codeforlife/settings/django.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from ..types import JsonDict
1818
from .custom import (
1919
ENV,
20+
REDIS_URL,
2021
SERVICE_BASE_DIR,
2122
SERVICE_BASE_URL,
2223
SERVICE_DOMAIN,
@@ -351,3 +352,13 @@ def get_databases():
351352
}
352353
),
353354
}
355+
356+
# Caches
357+
# https://docs.djangoproject.com/en/4.2/topics/cache/
358+
359+
CACHES = {
360+
"default": {
361+
"BACKEND": "django.core.cache.backends.redis.RedisCache",
362+
"LOCATION": REDIS_URL,
363+
}
364+
}

0 commit comments

Comments
 (0)