def create_app(run_mode=os.getenv('FLASK_ENV', 'production')): """Return a configured Flask App using the Factory method.""" app = Flask(__name__) app.config.from_object(config.CONFIGURATION[run_mode]) from pay_api.resources import API_BLUEPRINT, OPS_BLUEPRINT db.init_app(app) ma.init_app(app) app.register_blueprint(API_BLUEPRINT) app.register_blueprint(OPS_BLUEPRINT) app.after_request(convert_to_camel) setup_jwt_manager(app, jwt) ExceptionHandler(app) @app.after_request def add_version(response): # pylint: disable=unused-variable version = get_run_version() response.headers['API'] = f'pay_api/{version}' return response register_shellcontext(app) return app
def create_app(run_mode=os.getenv('FLASK_ENV', 'production')): """Return a configured Flask App using the Factory method.""" app = Flask(__name__) app.config.from_object(config.CONFIGURATION[run_mode]) db.init_app(app) ma.init_app(app) if run_mode != 'migration': # Configure Sentry if app.config.get('SENTRY_DSN', None): # pragma: no cover sentry_sdk.init(dsn=app.config.get('SENTRY_DSN'), integrations=[FlaskIntegration()]) # pylint: disable=import-outside-toplevel from pay_api.resources import API_BLUEPRINT, OPS_BLUEPRINT app.register_blueprint(API_BLUEPRINT) app.register_blueprint(OPS_BLUEPRINT) app.after_request(convert_to_camel) setup_jwt_manager(app, jwt) ExceptionHandler(app) @app.after_request def add_version(response): # pylint: disable=unused-variable version = get_run_version() response.headers['API'] = f'pay_api/{version}' return response register_shellcontext(app) build_cache(app) return app
def create_app(run_mode=os.getenv('FLASK_ENV', 'production')): """Return a configured Flask App using the Factory method.""" app = Flask(__name__) app.config.from_object(config.CONFIGURATION[run_mode]) # initialize tracer api_tracer = ApiTracer("Payment Services") global tracing # pylint: disable=global-statement,invalid-name tracing = ApiTracing(api_tracer.tracer) from pay_api.resources import API_BLUEPRINT, OPS_BLUEPRINT db.init_app(app) ma.init_app(app) app.register_blueprint(API_BLUEPRINT) app.register_blueprint(OPS_BLUEPRINT) setup_jwt_manager(app, jwt) @app.after_request def add_version(response): # pylint: disable=unused-variable version = get_run_version() response.headers['API'] = f'pay_api/{version}' return response register_shellcontext(app) return app
def create_app(run_mode=os.getenv('FLASK_ENV', 'production')): """Return a configured Flask App using the Factory method.""" app = Flask(__name__) app.config.from_object(config.CONFIGURATION[run_mode]) db.init_app(app) ma.init_app(app) setup_jwt_manager(app, jwt) register_shellcontext(app) return app
def create_app(run_mode=os.getenv('FLASK_ENV', 'production')): """Return a configured Flask App using the Factory method.""" from pay_api.models import db, ma app = Flask(__name__) app.config.from_object(config.CONFIGURATION[run_mode]) app.logger.info(f'<<<< Starting Payment Jobs >>>>') db.init_app(app) ma.init_app(app) register_shellcontext(app) return app
def create_app(run_mode=os.getenv('FLASK_ENV', 'production')): """Return a configured Flask App using the Factory method.""" app = Flask(__name__) app.config.from_object(config.CONFIGURATION[run_mode]) # Configure Sentry if app.config.get('SENTRY_DSN', None): # pragma: no cover sentry_sdk.init(dsn=app.config.get('SENTRY_DSN'), integrations=[FlaskIntegration()]) db.init_app(app) ma.init_app(app) register_shellcontext(app) return app
def create_app(run_mode=os.getenv('FLASK_ENV', 'production')): """Return a configured Flask App using the Factory method.""" app = Flask(__name__) app.config.from_object(config.CONFIGURATION[run_mode]) db.init_app(app) ma.init_app(app) # Init Flask Admin init_flask_admin(app) Keycloak(app) @app.route('/') def index(): return redirect('/admin/feecode/') return app