"""
not put in settings.py because everytime boot also will try to connect redis, so got own file, when need connect only import
"""
import redis
from django.conf import settings

# Connect to Redis (default: localhost:6379)
redis_client = redis.Redis(
    host=settings.REDIS_CONFIG["HOST"],
    port=settings.REDIS_CONFIG["PORT"],
    db=settings.REDIS_CONFIG["DB"],
    username=settings.REDIS_CONFIG["USERNAME"],
    password=settings.REDIS_CONFIG["PASSWORD"],
    decode_responses=True  # get strings instead of bytes
)