aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPriyansh <[email protected]>2021-12-09 01:40:53 -0500
committerPriyansh <[email protected]>2021-12-09 01:40:53 -0500
commitf7891739d704a8dda2f44fe152eca45aef8e8396 (patch)
treecdb07cd6f6be91d1f3ff3be037938174d7be5fcf
parent15b1a734b0b44bebe64df8f0bd514ac68dabb967 (diff)
downloadtemp_pred_arima-f7891739d704a8dda2f44fe152eca45aef8e8396.tar.xz
temp_pred_arima-f7891739d704a8dda2f44fe152eca45aef8e8396.zip
Code changes due to new project structure
-rw-r--r--app.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/app.py b/app.py
index 431bd66..f17fd5c 100644
--- a/app.py
+++ b/app.py
@@ -1,22 +1,16 @@
from flask import Flask, render_template
from flask import request
import pandas as pd
-from sql_functions import run_sql_pandas, get_list_of_dict
-from time_series_model import plot_data
+import json
app = Flask(__name__)
-def get_cities_list():
- sql_statement = 'SELECT DISTINCT(City_Name) as City_Name, Lat, Long FROM City_table join Loc_Table on City_Table.City_Id = Loc_table.City_Id'
- return run_sql_pandas(sql_statement)
-
@app.route("/")
@app.route("/index")
def index():
- cities_list = get_cities_list()
- keys = ("city", "latitude", "longitude")
- cities_list = get_list_of_dict(keys, cities_list)
- return render_template("index.html", cities_list=cities_list)
+ with open("cities.json", "r") as cities_list:
+ data = json.load(cities_list)
+ return render_template("index.html", cities_list=data)
@app.route("/receiveDates", methods=["POST"])
@@ -27,7 +21,6 @@ def receive_dates():
dates = []
for i in dates_unmf:
dates.append(i.strftime('%Y-%m-%d'))
- plot_data(dates)
return 'OK'
if __name__ == '__main__':