From 465deabd029e5c0701f371cc317cd2e78567b3ac Mon Sep 17 00:00:00 2001 From: Jocelyn Delande Date: Sun, 22 May 2016 00:04:50 +0200 Subject: [PATCH] Add a manage.py CLI (flask_script) As it's the Flask-Migrate way to expose its commands (./manage.py db command). In our case, it's specially useful for creating new migrations. --- budget/manage.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 budget/manage.py diff --git a/budget/manage.py b/budget/manage.py new file mode 100755 index 0000000..e0b25a7 --- /dev/null +++ b/budget/manage.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python + +from flask.ext.script import Manager +from flask.ext.migrate import Migrate, MigrateCommand + +from run import app +from models import db + +migrate = Migrate(app, db) + +manager = Manager(app) +manager.add_command('db', MigrateCommand) + + +if __name__ == '__main__': + manager.run()