15 lines
425 B
Python
15 lines
425 B
Python
import os
|
|
|
|
|
|
class RedisConfig:
|
|
|
|
HOST: str = os.getenv("REDIS_HOST", "10.10.2.15")
|
|
PASSWORD: str = os.getenv("REDIS_PASSWORD", "your_strong_password_here")
|
|
PORT: int = int(os.getenv("REDIS_PORT", 6379))
|
|
DB: int = int(os.getenv("REDIS_DB", 0))
|
|
|
|
@classmethod
|
|
def as_dict(cls):
|
|
return dict(host=RedisConfig.HOST, port=int(RedisConfig.PORT), password=RedisConfig.PASSWORD, db=int(RedisConfig.DB))
|
|
|