import redis try: r = redis.Redis(host='localhost', port=6379, db=0, socket_timeout=5) print(f"PING: {r.ping()}") print("Redis is ALIVE") except Exception as e: print(f"Redis ERROR: {e}")