12345678910111213141516171819202122 |
- from flask.cli import FlaskGroup
- from project import create_app
- from project.models import create_db, reset_db, migrate
- app = create_app()
- cli = FlaskGroup(app)
- @cli.command("create_db")
- def set_up_db():
- with app.app_context():
- create_db()
- @cli.command("reset_db")
- def resetdb():
- with app.app_context():
- reset_db()
- if __name__ == "__main__":
- cli()
|