From 549ebadd448dd0ed684e3a3aa0c4406208a1ae7d Mon Sep 17 00:00:00 2001 From: Wesley Kerfoot Date: Sat, 14 Sep 2019 12:54:07 -0400 Subject: [PATCH] Use environ instead of config --- app/website.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/website.py b/app/website.py index 34bf46d..a401ad9 100755 --- a/app/website.py +++ b/app/website.py @@ -46,9 +46,9 @@ def cacheit(key, thunk): def get_posts(): posts = getattr(g, "posts", None) if posts is None: - posts = g._posts = Posts(app.config.from_envvar("COUCHDB_USER"), - app.config.from_envvar("COUCHDB_PASSWORD"), - app.config.from_envvar("COUCHDB_NAME")) + posts = g._posts = Posts(environ.get("COUCHDB_USER"), + environ.get("COUCHDB_PASSWORD"), + environ.get("COUCHDB_NAME")) return posts def get_initial(): @@ -100,7 +100,7 @@ def NeverWhere(configfile=None): def admin_login(): password = request.args.get("password") success = False - if password == app.config["ADMIN_PASSWORD"]: + if password == environ.get("ADMIN_PASSWORD"): print("logged in successfully") success = True login_user(Admin())