From eb3f685d75dae62d4b048f231109b771b63cea27 Mon Sep 17 00:00:00 2001 From: Kiril Kovachev Date: Mon, 14 Oct 2024 12:15:47 +0100 Subject: [PATCH] Separate search into blueprint --- kanken_online/__init__.py | 7 ++----- kanken_online/search.py | 7 +++++++ 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 kanken_online/search.py diff --git a/kanken_online/__init__.py b/kanken_online/__init__.py index 93dcab7..ce7d027 100644 --- a/kanken_online/__init__.py +++ b/kanken_online/__init__.py @@ -62,17 +62,14 @@ def create_app(test_config=None): def kotoba_page(kotoba: str): return render_template("kotoba.html", kotoba=kotoba) - @app.route("/search") - def search_page(): - return render_template("search.html") - from . import database database.initialize_app(app) - from . import auth, api, forum + from . import auth, api, forum, search app.register_blueprint(auth.blueprint) app.register_blueprint(api.blueprint) app.register_blueprint(forum.blueprint) + app.register_blueprint(search.blueprint) from . import lang diff --git a/kanken_online/search.py b/kanken_online/search.py new file mode 100644 index 0000000..fcb5bb9 --- /dev/null +++ b/kanken_online/search.py @@ -0,0 +1,7 @@ +from flask import Blueprint, render_template + +blueprint = Blueprint("search", __name__, url_prefix="/search") + +@blueprint.route("/") +def search_page(): + return render_template("search.html")