diff --git a/src/smarttools/web/app.py b/src/smarttools/web/app.py index 252390a..46cffe1 100644 --- a/src/smarttools/web/app.py +++ b/src/smarttools/web/app.py @@ -19,6 +19,9 @@ from .sessions import SQLiteSessionInterface, cleanup_expired_sessions def create_web_app() -> Flask: app = registry_app.create_app() + # Import routes BEFORE registering blueprint + from . import routes # noqa: F401 + app.register_blueprint(web_bp) # Session configuration @@ -47,10 +50,6 @@ def create_web_app() -> Flask: app.add_url_rule("/sitemap.xml", endpoint="web.sitemap", view_func=sitemap_response) app.add_url_rule("/robots.txt", endpoint="web.robots", view_func=robots_txt) - # Ensure routes are registered - from . import routes # noqa: F401 - - # Auth routes are registered via blueprint import side effects return app