summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHongkuan Wang <hongkuan.wang@shopee.com>2021-10-06 22:23:55 +0800
committerDavid Lord <davidism@gmail.com>2021-10-06 07:45:47 -0700
commitb3eb374e1c653868e86bb971e625e10d535c6f75 (patch)
tree34a32ffec94222296396b6fd05fc3431b4d75e42
parent532479573ab3ecd815795df58a48ae7d68777ee0 (diff)
downloadwerkzeug-b3eb374e1c653868e86bb971e625e10d535c6f75.tar.gz
shortly example opens redis with decode_responses=True
-rw-r--r--examples/shortly/shortly.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/shortly/shortly.py b/examples/shortly/shortly.py
index 063bf265..10e957e8 100644
--- a/examples/shortly/shortly.py
+++ b/examples/shortly/shortly.py
@@ -37,7 +37,9 @@ def get_hostname(url):
class Shortly:
def __init__(self, config):
- self.redis = redis.Redis(config["redis_host"], config["redis_port"])
+ self.redis = redis.Redis(
+ config["redis_host"], config["redis_port"], decode_responses=True
+ )
template_path = os.path.join(os.path.dirname(__file__), "templates")
self.jinja_env = Environment(
loader=FileSystemLoader(template_path), autoescape=True