From 52b2b9b8a68572207d9165e57b50fd90c63b1d1e Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Tue, 3 Nov 2020 17:29:04 +0300 Subject: Add and register glossary blueprint --- wqflask/wqflask/__init__.py | 3 +++ wqflask/wqflask/glossary.py | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100644 wqflask/wqflask/glossary.py diff --git a/wqflask/wqflask/__init__.py b/wqflask/wqflask/__init__.py index eeece241..a3870ce6 100644 --- a/wqflask/wqflask/__init__.py +++ b/wqflask/wqflask/__init__.py @@ -6,6 +6,7 @@ import jinja2 from flask import g from flask import Flask from utility import formatting +from wqflask.glossary import glossary_blueprint app = Flask(__name__) @@ -16,6 +17,8 @@ app.jinja_env.globals.update( undefined=jinja2.StrictUndefined, numify=formatting.numify) +# Registering blueprints +app.register_blueprint(glossary_blueprint, url_prefix="/glossary") @app.before_request def before_request(): diff --git a/wqflask/wqflask/glossary.py b/wqflask/wqflask/glossary.py new file mode 100644 index 00000000..0918744a --- /dev/null +++ b/wqflask/wqflask/glossary.py @@ -0,0 +1,9 @@ +from flask import Blueprint + + +glossary_blueprint = Blueprint('glossary_blueprint', __name__) + + +@glossary_blueprint.route('/') +def glossary(): + return "This is a test", 200 -- cgit v1.2.3