From c7b6cebcdd60af46a94b7c9559ba0db03633c8ed Mon Sep 17 00:00:00 2001 From: Justin Date: Wed, 2 Mar 2022 22:49:44 +0800 Subject: [PATCH] display api key for weather features --- server.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 38fca90..6e36c90 100755 --- a/server.py +++ b/server.py @@ -104,7 +104,9 @@ def index(): elif professional: currently_displaying = json.load(open('csv/display_settings.json', 'r'))[1] not_displaying = [f for f in all_features if f not in currently_displaying[0] and f not in currently_displaying[1]] - + + with open('api_keys.txt', 'r') as f: + api_key2 = f.readlines() now = datetime.datetime.now() @@ -126,6 +128,7 @@ def index(): GIF_settings = json.load(open('csv/GIF_settings.json', 'r')) message_settings = json.load(open('csv/message_settings.json', 'r')) general_settings = json.load(open('csv/general_settings.json', 'r')) + api_keys = api_key2[1] templateData = { @@ -146,7 +149,8 @@ def index(): 'GIF_settings':GIF_settings, 'message_settings':message_settings, 'professional':professional, - 'general_settings':general_settings + 'general_settings':general_settings, + 'api_keys':api_keys } return render_template('index.html', **templateData)