#!/usr/bin/env python from flask_migrate import Manager, MigrateCommand from website import app manager = Manager(app) manager.add_command('db', MigrateCommand) if __name__ == '__main__': manager.run()
from flask import Flask from flask_migrate import Migrate, Manager, MigrateCommand from app.model.base import db app = Flask(__name__) app.config.from_pyfile('secure.py') app.config.from_pyfile('settings.py') migrate = Migrate(app, db) manager = Manager(app) manager.add_command('db', MigrateCommand) if __name__ == '__main__': manager.run()
import pymysql from flask_migrate import Manager, MigrateCommand, Migrate from app import create_app pymysql.install_as_MySQLdb() app = create_app(config='dev') manage = Manager(app=app) manage.add_command('db', MigrateCommand) if __name__ == '__main__': manage.run()