flask_migrate TypeError: 'NoneType' object is not callable

49 views Asked by At

I am trying to create a database migration and after entering the code below, TypeError: 'NoneType' object is not callable. Somehow I can't figure out the cause of the problem, would anyone please know?

import root
from root import models
from flask_migrate import Migrate, Manager, MigrateCommand
app = root.app

app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///databaze.sqlite3"

migrate = Migrate(app, root.db)
manager = Manager(app)

manager.add_command("db", MigrateCommand)

if __name__ == "__main__":
    manager.run()


Traceback (most recent call last):
  File "D:\xxxxxxx\manager.py", line 10, in <module>
    manager = Manager(app)
              ^^^^^^^^^^^^
TypeError: 'NoneType' object is not callable
0

There are 0 answers