add redis persistance

This commit is contained in:
FuzzyGrim
2024-02-29 16:30:58 +01:00
parent c4b1633943
commit 2e17c02925
3 changed files with 5 additions and 1 deletions

View File

@@ -5,3 +5,5 @@ __pycache__
venv
src/staticfiles
src/db/db.sqlite3
src/db/redis.db
src/db/redis.db.settings

2
.gitignore vendored
View File

@@ -5,3 +5,5 @@ __pycache__
venv
src/staticfiles
src/db/db.sqlite3
src/db/redis.db
src/db/redis.db.settings

View File

@@ -187,7 +187,7 @@ AUTH_USER_MODEL = "users.User"
IMG_NONE = "https://www.themoviedb.org/assets/2/v4/glyphicons/basic/glyphicons-basic-38-picture-grey-c2ebdbb057f2a7614185931650f8cee23fa137b93812ccb132b9df511df1cfac.svg"
backend = requests_cache.RedisCache(connection=Redis())
backend = requests_cache.RedisCache(connection=Redis(BASE_DIR / "db" / "redis.db"))
requests_cache.install_cache(
backend=backend,
expire_after=21600,