import json import matplotlib import matplotlib.pyplot as plt from flask import Flask, request, render_template, current_app from flask_logs import LogSetup import yfinance as yf import gym import gym_anytrading matplotlib.use('Agg') app = Flask(__name__, static_folder='./static', template_folder="./templates") app.config["LOG_TYPE"] = os.environ.get("LOG_TYPE", "stream") app.config["LOG_LEVEL"] = os.environ.get("LOG_LEVEL", "INFO") logs = LogSetup() logs.init_app(app) # If `entrypoint` is not defined in app.yaml, App Engine will look for an app # called `app` in `main.py`. curr_pairs = { "EUR/USD": "EURUSD=X", "USD/JPY": "JPY=X", "GBP/USD": "GBPUSD=X", "AUD/USD": "AUDUSD=X", "NZD/USD": "NZDUSD=X", "GBP/JPY": "GBPJPY=X", "EUR/GBP": "EURGBP=X", "EUR/CAD": "EURCAD=X", "EUR/SEK": "EURSEK=X",
from flask_logs import LogSetup logs = LogSetup()
def initialize_app(): logs = LogSetup() logs.init_app(app) # create a consumer group once my_cg_ops = ConsumerGroupOps() cg = my_cg_ops.get_consumer_group(create=True)