from flask_script import (Manager, Shell, Server) from flask_migrate import MigrateCommand from kepavi.app import create_app from kepavi.extensions import db # Use the development configuration if available try: from kepavi.configs.development import DevelopmentConfig as Config except ImportError: from kepavi.configs.default import DefaultConfig as Config from kepavi.kegg_utils import Organism, Kegg flask_app = create_app(Config) manager = Manager(flask_app) # Run local server manager.add_command("runserver", Server("localhost", port=5000)) # Migration commands manager.add_command('db', MigrateCommand) # Add interactive project shell def make_shell_context(): return dict(app=current_app, db=db) manager.add_command("shell", Shell(make_context=make_shell_context))