python
config_error
ai_generated
true
AssertionError: A blueprint's name collision occurred between <Blueprint 'api'> and <Blueprint 'api'>. Either specify a unique name or register them under different prefixes.
ID: python/flask-blueprint-name-conflict
80%Fix Rate
88%Confidence
0Evidence
2025-07-30First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 2.x | active | — | — | — |
| 3.x | active | — | — | — |
Root Cause
Two Blueprint objects with the same name are registered on the same app, or a blueprint is registered twice.
generic中文
两个同名 Blueprint 对象注册到同一个 app,或同一蓝图被注册两次。
Workarounds
-
95% success
Give unique names: `api_v1 = Blueprint('api_v1', __name__)` and `api_v2 = Blueprint('api_v2', __name__)`. -
90% success
Register with a prefix: `app.register_blueprint(api, url_prefix='/v1')` and ensure names differ.
Dead Ends
Common approaches that don't work:
-
90% fail
Name still collides; url_prefix does not change the blueprint name.
-
85% fail
Second blueprint's routes are silently dropped.