Flask/project_name/ext/webui/__init__.py

17 lines
467 B
Python
Raw Permalink Normal View History

2024-11-10 07:27:36 -08:00
from flask import Blueprint
from .views import index, only_admin, product, secret
bp = Blueprint("webui", __name__, template_folder="templates")
bp.add_url_rule("/", view_func=index)
bp.add_url_rule(
"/product/<product_id>", view_func=product, endpoint="productview"
)
bp.add_url_rule("/secret", view_func=secret, endpoint="secret")
bp.add_url_rule("/only_admin", view_func=only_admin, endpoint="onlyadmin")
def init_app(app):
app.register_blueprint(bp)