Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The name 'collection' is already registered for this blueprint. Use 'name=' to provide a unique name. This will become an error in Flask 2.1

Tags:

python

flask

from collection import collection_api

app.register_blueprint(collection_api, url_prefix="/typing-session")
app.register_blueprint(collection_api, url_prefix="/api/dataservice/typing-session)

It is already created, how do i fix this?

like image 882
AtHuuu Avatar asked Nov 14 '25 16:11

AtHuuu


1 Answers

You are trying to register the same Blueprint twice.

Change the second line to app.register_blueprint(collection_api, name="<some_unique_name>", url_prefix="/api/dataservice/typing-session)

like image 81
Simeon Nedkov Avatar answered Nov 17 '25 08:11

Simeon Nedkov