shortener/shortener/cache.py

9 lines
231 B
Python

import os
import redis
REDIS_HOST = os.getenv("REDIS_HOST", "localhost")
REDIS_PORT = int(os.getenv("REDIS_PORT", 6379))
REDIS_DB = int(os.getenv("REDIS_DB", 0))
cache = redis.Redis(host=REDIS_HOST, port=REDIS_PORT, db=REDIS_DB)