Circular import of db reference using Flask-SQLAlchemy and Blueprints

I fixed the problem with the help of the Application Factory pattern. I declare the database in a third module and configure it later in the same module in which I start the application. This results in the following imports: database.py → app.py views.py → app.py database.py → views.py There is no circular import. It … Read more