# based on https://gist.github.com/rduplain/1641344 import os from flask import Flask, make_response, request, render_template from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas import plots config = { "DEBUG": True # run app in debug mode } app = Flask(__name__) def figure(): plots.plot() @app.route('/', methods=["GET"]) def root(): title = "Project Numeri" figure() plots = os.listdir(os.path.join(app.static_folder, "plots")) return render_template('index.html', title=title, plots=plots) # @app.route('/', methods=['POST']) # def my_form_post(): # text = request.form['text'] # processed_text = text.upper() # return processed_text # def grades(): # grades_list = pd.read_csv("*.csv") # print(grades_list) if __name__ == '__main__': app.run(debug=True, port=5002)