From aa4d213692cb27a903fe1593e2dd3387e638b350 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 15 Jun 2023 14:40:37 +0300 Subject: Configs: Introduce Blueprints. Refactor configs in webqtlConfig. * Introduce flask Blueprints to help with decoupling the various modules from the `wqflask/__init__.py` module * Refactor settings: Create a function `base.webqtlConfig.init_app(...)` to handle setting up the configurations on the app correctly. Call this function at app creation time. * Move configuration utility functions from `utility.tools` module to `utility.configuration` module. * Use the `get_setting(...)` function to retrieve configuration settings from the application. --- wqflask/utility/hmac.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'wqflask/utility/hmac.py') diff --git a/wqflask/utility/hmac.py b/wqflask/utility/hmac.py index 29891677..2fb8b106 100644 --- a/wqflask/utility/hmac.py +++ b/wqflask/utility/hmac.py @@ -1,9 +1,7 @@ import hmac import hashlib -from flask import url_for - -from wqflask import app +from flask import url_for, current_app as app def hmac_creation(stringy): @@ -37,7 +35,3 @@ def url_for_hmac(endpoint, **values): else: combiner = "?" return url + combiner + "hm=" + hm - - -app.jinja_env.globals.update(url_for_hmac=url_for_hmac, - data_hmac=data_hmac) -- cgit v1.2.3