Learning Python Flask MVC Framework

2018-01-10. Category & Tags: Flask, MVC-like

Run A Demo # a simple getting-start # Let’s take the example below (Serving Prophet Model with Flask — Predicting Future (very simple) 2019.07). Download the saved model and put to the same folder as app.py which is: from flask import Flask, jsonify, request from flask_cors import CORS, cross_origin import pickle with open('forecast_model.pckl', 'rb') as fin: m2 = pickle.load(fin) app = Flask(__name__) CORS(app) @app.route("/katana-ml/api/v1.0/forecast/ironsteel", methods=['POST']) def predict(): horizon = int(request. ...