Example #1
0
def create_manager():
    eve_app = create_app(os.getenv('FLASK_CONFIG') or 'default')

    manager = Manager(eve_app)

    from app.models import db
    # add tools to manager  https://flask-script.readthedocs.io/en/latest/#sub-managers
    MigrateCommand.add_command('push_triggers', ApplyTriggersCommand)
    MigrateCommand.add_command('drop_triggers', DropAllTriggersCommand)
    migrate = Migrate(eve_app, db)
    manager.add_command('db', MigrateCommand)

    from app.management import create_manager as create_app_manager
    manager.add_command('app', create_app_manager())

    return manager
Example #2
0
from flask_script import Manager
from flask_migrate import MigrateCommand
import app

manager = Manager(app)
manager.add_command('db', MigrateCommand())

if __name__ == '__main__':
    manager.run()
Example #3
0
def migrate_db():
    """DB Migration tool injection
    """
    MigrateCommand()
Example #4
0
def db():
    """Flask-migrate commands"""
    MigrateCommand()
Example #5
0
def migrate_command():
    MigrateCommand()
def db():
    """Flask-migrate integration"""
    MigrateCommand()
Example #7
0
def dbmanger():
    MigrateCommand()
Example #8
0
# config=utf-8
import os
from flask_migrate import Migrate, MigrateCommand
from application import create_app, db
from application.auth.views import Users

application = create_app(os.getenv('FLASK_CONFIG') or 'default')
migrate = Migrate(application, db)
MigrateCommand.add_command('db', MigrateCommand)


@application.shell_context_processor
def make_shell_context():
    return dict(db=db, Users=Users)
Example #9
0
import os

from flask import render_template
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager, Shell

from app import create_app

env_config = os.environ.get("FLASK_ENV", "default")


def make_shell_context():
    return None


app = create_app(config_name=env_config)
manager = Manager(app=app)
migrate = Migrate(app=app)

manager.add_command('db', MigrateCommand(app=app))
manager.add_command('shell', Shell(make_context=make_shell_context))


@app.errorhandler(404)
def page_not_found(error):
    return render_template('home/404.html'), 404


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