def app(): """ Setup our flask test app, this only gets executed once :return: Flask app """ params = { 'DEBUG': False, 'TESTING': True } _app = create_app(settings_override=params) # Establish application context before running tests ctx = _app.app_context() ctx.push() yield _app ctx.pop()
# -*- coding: utf-8 -*- import os from core.app import create_app from gevent.pywsgi import WSGIServer import werkzeug.serving app = create_app() app.config['PROPAGATE_EXCEPTIONS'] = True @werkzeug.serving.run_with_reloader def runServer(): http_server = WSGIServer(('0.0.0.0', 5000), app) print("Gevent serve forever on", 5000) http_server.serve_forever() # from core.app import create_app as app # if __name__ == '__main__': # app.run()
from core.app import create_app application = create_app({ 'SECRET_KEY': 'secret', }) if __name__ == '__main__': application.run(host="127.0.0.1", port=5000, debug=True)
from core import app, views, async web = app.create_app(views) async = async.create_app()
def app(): """ Instance of Main flask app """ return create_app()
from core.app import app_name, create_app if __name__ == '__main__': print(app_name) create_app().run()
from core import app, views, async web = app.create_app(views) async = async .create_app()
def app(): app = create_app() app.debug = True return app
def instance_app(): instance_app = create_app() return instance_app
def setUp(self): self.client = create_app(DevConfig).test_client()
# -*- coding: utf-8 -*- """Create an application instance.""" from core.app import create_app from core.settings import ProductionConfig app = create_app(ProductionConfig)