# 延迟导入,避免循环依赖 __all__ = ["app"] # 导入 tools 模块,触发工具注册 import app.tools def __getattr__(name): if name == "app": from app.main import app return app raise AttributeError(f"module {__name__!r} has no attribute {name!r}")