From 36489e2921977c71bc6d6ce8355defc62cfd1e96 Mon Sep 17 00:00:00 2001 From: Stefan Pratter Date: Wed, 25 Oct 2023 17:48:52 +0300 Subject: [PATCH] use debug print (#1460) * use debug print * suppress python warnings during whois --- in.whoisd | 5 +++++ mainsite/settings/__init__.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/in.whoisd b/in.whoisd index 4ee921cc..1c2df634 100755 --- a/in.whoisd +++ b/in.whoisd @@ -4,6 +4,11 @@ import logging import os import sys +import warnings + +# supress warnings + +warnings.filterwarnings("ignore") # print "path", sys.path diff --git a/mainsite/settings/__init__.py b/mainsite/settings/__init__.py index b9fb49d8..dd07db3f 100644 --- a/mainsite/settings/__init__.py +++ b/mainsite/settings/__init__.py @@ -258,7 +258,7 @@ def get_cache_backend(cache_name): if cache_backend == "RedisCache": if can_ping_redis(REDIS_HOST, REDIS_PORT, REDIS_PASSWORD): - print("Was able to ping Redis, using RedisCache") + print_debug("Was able to ping Redis, using RedisCache") return { "BACKEND": "django.core.cache.backends.redis.RedisCache", "LOCATION": f"redis://:{REDIS_PASSWORD}@{REDIS_HOST}:{REDIS_PORT}", @@ -270,7 +270,7 @@ def get_cache_backend(cache_name): cache_backend = ( "DatabaseCache" if cache_name == "session" else "LocMemCache" ) - print(f"Was not able to ping Redis, falling back to {cache_backend}") + print_debug(f"Was not able to ping Redis, falling back to {cache_backend}") if cache_backend == "LocMemCache": return {