python
config_error
ai_generated
true
AssertionError: A blueprint cannot be registered more than once
ID: python/flask-blueprint-registration
80%Fix Rate
84%Confidence
0Evidence
2025-06-10First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
在Flask应用中重复注册同一个蓝图实例。
generic中文
在Flask应用中重复注册同一个蓝图实例。
Workarounds
-
95% success
只注册一次: from blueprints import auth_bp app.register_blueprint(auth_bp) # 不要再次注册
-
90% success
每次创建新实例: auth_bp = Blueprint('auth', __name__) app.register_blueprint(auth_bp)
Dead Ends
Common approaches that don't work:
-
60% fail
尝试创建新蓝图但使用了相同名称。
-
80% fail
在多个文件中导入并注册同一蓝图。