I have a Flask 0.12.4 app and am using Flask-Admin.
I get this error intermittently when developing locally, and have just started seeing it in one of our public environments too.
AssertionError: A blueprint's name collision occurred between
<flask.blueprints.Blueprint object at 0x7f5cd31f96d0> and
<flask.blueprints.Blueprint object at 0x7f5cd33b0d90>.
Both share the same name "admin".
Blueprints that are created on the fly need unique names.
The steps to reproduce in my development environment are slightly odd:
- Break some of the admin config (e.g. change one of the strings relating to a column name in
form_columns
so it refers to a non-existent name) - Refresh the browser to see the regular "unknown field" error
- Revert the change
- Refresh the browser again - you then see the blueprint error above
The line which is causing the error is this one:
# admin.py
admin = flask_admin.Admin(
app, index_view=MyIndexView(), template_mode="bootstrap3"
)
:-)
– halfer