File size: 375 Bytes
0b2c9fd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
)