Use Redis for caching

This commit is contained in:
R. Miles McCain 2020-04-14 16:02:49 -04:00
parent 73b8fc96d4
commit 5368c9da12
No known key found for this signature in database
GPG Key ID: 91CB47BDDF2671A5
4 changed files with 55 additions and 19 deletions

View File

@ -20,6 +20,8 @@ emoji-country-flag = "*"
rules = "*"
gunicorn = "*"
psycopg2 = "*"
redis = "*"
django-redis-cache = "*"
[requires]
python_version = "3.6"

25
Pipfile.lock generated
View File

@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
"sha256": "11fb482879db5415b0e23111fa01c485ef40663567bb5837fe02d9c2dbf0e337"
"sha256": "ed79d7965e276156d03c4710bf0d6b35750f9f87d37750d50838b53aeeaaa815"
},
"pipfile-spec": 6,
"requires": {
@ -88,6 +88,14 @@
"index": "pypi",
"version": "==2.1.0"
},
"django-redis-cache": {
"hashes": [
"sha256:5c581743de5994e6b15abfd5b3dbcb8bf00e42d97658c96b7218bcb6a63f863b",
"sha256:bc0eaf20d275708e0437cbea28f9965e1922c15291f6206edbef3966c029836b"
],
"index": "pypi",
"version": "==2.1.0"
},
"emoji-country-flag": {
"hashes": [
"sha256:67c0cb6a3765fb53f31b34160d6b1c8a5f44b297bc278d1835c6f2e5b0a9a592",
@ -197,6 +205,14 @@
"index": "pypi",
"version": "==5.3.1"
},
"redis": {
"hashes": [
"sha256:0dcfb335921b88a850d461dc255ff4708294943322bd55de6cfd68972490ca1f",
"sha256:b205cffd05ebfd0a468db74f0eedbff8df1a7bfc47521516ade4692991bb0833"
],
"index": "pypi",
"version": "==3.4.1"
},
"requests": {
"hashes": [
"sha256:43999036bfa82904b6af1d99e4882b560e5e2c68e5c4b0aa03b655f3d7d73fee",
@ -218,6 +234,13 @@
"index": "pypi",
"version": "==2.2"
},
"six": {
"hashes": [
"sha256:236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a",
"sha256:8f3cd2e254d8f793e7f3d6d9df77b92252b52637291d0f0da013c76ea2724b6c"
],
"version": "==1.14.0"
},
"sqlparse": {
"hashes": [
"sha256:022fb9c87b524d1f7862b3037e541f68597a730a8843245c349fc93e1643dc4e",

View File

@ -17,7 +17,7 @@ spec:
spec:
containers:
- name: "covideo-webserver"
image: "docker.pkg.github.com/milesmcc/shynet/shynet:latest"
image: "milesmcc/shynet:latest"
command: ["./webserver.sh"]
imagePullPolicy: Always
envFrom:
@ -43,7 +43,7 @@ spec:
spec:
containers:
- name: "covideo-celeryworker"
image: "docker.pkg.github.com/milesmcc/shynet/shynet:latest"
image: "milesmcc/shynet:latest"
command: ["./celeryworker.sh"]
imagePullPolicy: Always
envFrom:

View File

@ -140,6 +140,17 @@ STATIC_URL = "/static/"
STATIC_ROOT = "compiledstatic/"
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
# Redis
# Redis cache
if not DEBUG:
CACHES = {
"default": {
"BACKEND": "redis_cache.RedisCache",
"LOCATION": os.getenv("REDIS_CACHE_LOCATION"),
"KEY_PREFIX": "v1_", # Increment when migrations occur
}
}
# Auth