Quellcode durchsuchen

Upgrade to django-redis for cachalot

Colin Powell vor 2 Jahren
Ursprung
Commit
b0fb62bdb9
3 geänderte Dateien mit 22 neuen und 4 gelöschten Zeilen
  1. 20 1
      poetry.lock
  2. 1 0
      pyproject.toml
  3. 1 3
      vrobbler/settings.py

+ 20 - 1
poetry.lock

@@ -440,6 +440,21 @@ category = "main"
 optional = false
 python-versions = "*"
 
+[[package]]
+name = "django-redis"
+version = "5.2.0"
+description = "Full featured redis cache backend for Django."
+category = "main"
+optional = false
+python-versions = ">=3.6"
+
+[package.dependencies]
+Django = ">=2.2"
+redis = ">=3,<4.0.0 || >4.0.0,<4.0.1 || >4.0.1"
+
+[package.extras]
+hiredis = ["redis[hiredis] (>=3,!=4.0.0,!=4.0.1)"]
+
 [[package]]
 name = "django-simple-history"
 version = "3.2.0"
@@ -1491,7 +1506,7 @@ testing = ["flake8 (<5)", "func-timeout", "jaraco.functools", "jaraco.itertools"
 [metadata]
 lock-version = "1.1"
 python-versions = "^3.8"
-content-hash = "32f195ac129f5d8984ac82d42fa970f127ebea8f86f42d6d7cefc443c788b46a"
+content-hash = "0e23dbecb64cbef4dfe51bdf47e0f6b1357aab1d34342fef5341eaead2c26f1e"
 
 [metadata.files]
 amqp = [
@@ -1867,6 +1882,10 @@ django-mathfilters = [
     {file = "django-mathfilters-1.0.0.tar.gz", hash = "sha256:c9b892ef6dfc893683e75cfd0279c187a601ca68f4684c38f9da44657fb64b07"},
     {file = "django_mathfilters-1.0.0-py3-none-any.whl", hash = "sha256:64200a21bb249fbf27be601d4bbb788779e09c6e063170c097cd82c4d18ebb83"},
 ]
+django-redis = [
+    {file = "django-redis-5.2.0.tar.gz", hash = "sha256:8a99e5582c79f894168f5865c52bd921213253b7fd64d16733ae4591564465de"},
+    {file = "django_redis-5.2.0-py3-none-any.whl", hash = "sha256:1d037dc02b11ad7aa11f655d26dac3fb1af32630f61ef4428860a2e29ff92026"},
+]
 django-simple-history = [
     {file = "django-simple-history-3.2.0.tar.gz", hash = "sha256:bff0a756238b2fa048ea3ffe8224b4edd421559123ff9ce5c27682c37c6a7702"},
     {file = "django_simple_history-3.2.0-py3-none-any.whl", hash = "sha256:516e1872c2028c31f77208f542967e81bd3bf75623e69fe7008d5d3d15e33534"},

+ 1 - 0
pyproject.toml

@@ -32,6 +32,7 @@ cinemagoer = "^2022.12.27"
 pysportsdb = "^0.1.0"
 django-cachalot = "^2.5.2"
 pytz = "^2022.7.1"
+django-redis = "^5.2.0"
 
 [tool.poetry.dev-dependencies]
 Werkzeug = "2.0.3"

+ 1 - 3
vrobbler/settings.py

@@ -145,9 +145,7 @@ CACHES = {
     }
 }
 if REDIS_URL:
-    CACHES["default"][
-        "BACKEND"
-    ] = "django.core.cache.backends.redis.RedisCache"
+    CACHES["default"]["BACKEND"] = "django_redis.cache.RedisCache"
     CACHES["default"]["LOCATION"] = REDIS_URL
 
 SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"