from redis import Redis import os # Load Redis credentials from environment password = os.environ['REDIS_PASSWORD'] host = os.environ['REDIS_HOST'] port = os.environ.get('REDIS_PORT', 6379) # default fallback # Initialize Redis client redis_client = Redis( host=host, port=port, db=0, decode_responses=True, username="default", password=password )