Separate search into blueprint

This commit is contained in:
Kiril Kovachev 2024-10-14 12:15:47 +01:00
parent 469bf8dfd7
commit eb3f685d75
2 changed files with 9 additions and 5 deletions

View File

@ -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

7
kanken_online/search.py Normal file
View File

@ -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")