from Application import create_app app = create_app() if __name__ == '__main__': app.run()
from Application import create_app app = create_app(debug=True) if __name__ == '__main__': app.run()
from Application import create_app from config import get_config from flask_script import Manager from flask_migrate import MigrateCommand import logging logging.basicConfig(level=logging.DEBUG) config = get_config() app = create_app(config_obj=config) manager = Manager(app) manager.add_command('db', MigrateCommand) if __name__ == '__main__': manager.run()
from Application import create_app from config import get_config app = create_app(config_obj=get_config())
def setUp(self): self.app = create_app(config_obj=get_config()) self.app.config['TESTING'] = True self.app = self.app.test_client()
""" manage.py Scripts for running the applications """ import subprocess as sp from flask_script import Manager, Shell, Server as OldServer from flask_migrate import MigrateCommand, Migrate from Application import create_app, db from Application.settings import get_config_for_current_environment from Application.auth.models import User app = create_app(get_config_for_current_environment()) manager = Manager(app) migrate = Migrate(app, db) class Server(OldServer): def __call__(self, *args, **kwargs): app.config["ASSETS_URL"] = "http://localhost:5001/static/" webpack_server = sp.Popen(["/usr/bin/node", "node_modules/webpack-dev-server/bin/webpack-dev-server.js", "--content-base", "Application/static", "--output-public-path", "http://localhost:5000/static/", "--inline", "--hot", "--port", "5001", ], cwd="Application/app_src")
def client(): app = create_app({'TESTING': True, 'HOST': 'http://localhost'}) with app.test_client() as client: yield client
from Application import create_app from settings import Base app = create_app(Base()) if __name__ == '__main__': app.run()