1

I'm using Python with Flask, and I'm trying to migrate the database. I run flask db init and I get No handlers could be found for logger "root". Here is my main script:

import os
from flask_migrate import Migrate
from app import create_app, db
from app.models import User, Role
from flask_script import Manager

app = create_app(os.getenv('FLASK_CONFIG') or 'default')
migrate = Migrate(app, db)
manager = Manager(app)
app.config.update(dict(
    SECRET_KEY="powerful secretkey",
    WTF_CSRF_SECRET_KEY="a csrf secret key"
))


@manager.command
def hello():
    print("hello")


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


@app.shell_context_processor
def make_shell_context():
    return dict(db=db, User=User, Role=Role)

The server runs ok, but I don't have the database and I should migrate it. Can you help me with this problem?

scheebler
  • 15
  • 5
  • 1
    Could be because you may have migration directory already created. Delete it and run again to fix this issue. – Viswesn Dec 29 '18 at 17:06

0 Answers0