aboutsummaryrefslogtreecommitdiff
path: root/middleware
diff options
context:
space:
mode:
authorBobby <[email protected]>2023-11-10 23:49:33 -0500
committerBobby <[email protected]>2023-11-10 23:49:33 -0500
commit9f5c83865ebcca3293d8f30dea6ea6fa8ed5abc2 (patch)
treea61e00f74fd8b6222f7c34e29bd25f7243e33a72 /middleware
parenta79e6040f7d79c658374ceab26f90bd9f1d9ea59 (diff)
downloadthatcomputerscientist-9f5c83865ebcca3293d8f30dea6ea6fa8ed5abc2.tar.xz
thatcomputerscientist-9f5c83865ebcca3293d8f30dea6ea6fa8ed5abc2.zip
Moved to Redis Cloud
Diffstat (limited to 'middleware')
-rw-r--r--middleware/uuidmiddleware.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/middleware/uuidmiddleware.py b/middleware/uuidmiddleware.py
index a6dd1ca3..42fe5903 100644
--- a/middleware/uuidmiddleware.py
+++ b/middleware/uuidmiddleware.py
@@ -2,9 +2,17 @@ import json
import uuid
import redis
+import os
+from dotenv import load_dotenv
-redis_instance = redis.StrictRedis(host='localhost', port=6379, db=0)
+load_dotenv()
+redis_instance = redis.StrictRedis(
+ host=os.getenv('REDIS_HOST'),
+ port=os.getenv('REDIS_PORT'),
+ password=os.getenv('REDIS_PASSWORD'),
+ db=0
+)
class UserUUIDMiddleware:
# assign a uuid to the user if they don't have one