Use Redis for caching
This commit is contained in:
parent
73b8fc96d4
commit
5368c9da12
2
Pipfile
2
Pipfile
@ -20,6 +20,8 @@ emoji-country-flag = "*"
|
||||
rules = "*"
|
||||
gunicorn = "*"
|
||||
psycopg2 = "*"
|
||||
redis = "*"
|
||||
django-redis-cache = "*"
|
||||
|
||||
[requires]
|
||||
python_version = "3.6"
|
||||
|
25
Pipfile.lock
generated
25
Pipfile.lock
generated
@ -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",
|
||||
|
@ -16,13 +16,13 @@ spec:
|
||||
app: "shynet-webserver"
|
||||
spec:
|
||||
containers:
|
||||
- name: "covideo-webserver"
|
||||
image: "docker.pkg.github.com/milesmcc/shynet/shynet:latest"
|
||||
command: ["./webserver.sh"]
|
||||
imagePullPolicy: Always
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: django-settings
|
||||
- name: "covideo-webserver"
|
||||
image: "milesmcc/shynet:latest"
|
||||
command: ["./webserver.sh"]
|
||||
imagePullPolicy: Always
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: django-settings
|
||||
---
|
||||
apiVersion: "apps/v1"
|
||||
kind: "Deployment"
|
||||
@ -30,25 +30,25 @@ metadata:
|
||||
name: "shynet-celeryworker"
|
||||
namespace: "default"
|
||||
labels:
|
||||
app: "shynet-celeryworker"
|
||||
app: "shynet-celeryworker"
|
||||
spec:
|
||||
replicas: 3
|
||||
selector:
|
||||
matchLabels:
|
||||
app: "shynet-celeryworker"
|
||||
matchLabels:
|
||||
app: "shynet-celeryworker"
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: "shynet-celeryworker"
|
||||
spec:
|
||||
containers:
|
||||
metadata:
|
||||
labels:
|
||||
app: "shynet-celeryworker"
|
||||
spec:
|
||||
containers:
|
||||
- name: "covideo-celeryworker"
|
||||
image: "docker.pkg.github.com/milesmcc/shynet/shynet:latest"
|
||||
image: "milesmcc/shynet:latest"
|
||||
command: ["./celeryworker.sh"]
|
||||
imagePullPolicy: Always
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: django-settings
|
||||
- secretRef:
|
||||
name: django-settings
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user