-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.py
40 lines (28 loc) · 997 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import json
from flask import *
from flask import render_template
# creates a Flask application, named app
from templates.predCPI import get_fig_cpi
from templates.predCarbonTax import get_fig_carbon
from templates.stats import get_figs
app = Flask(__name__, static_url_path='/static', template_folder='static', )
# a route where we will display a welcome message via an HTML template
@app.route("/")
@app.route("/index.html")
def home():
return render_template("index.html")
@app.route("/availability.html")
def availability():
fig1 = get_fig_cpi()
fig2 = get_fig_carbon()
return render_template("availability.html", f1=fig1, f2=fig2)
@app.route("/ownership.html")
def owner():
return render_template("ownership.html")
@app.route("/stats.html")
def page3():
fig1, fig2, fig3, fig4 = get_figs()
return render_template("stats.html", f1=fig1, f2=fig2, f3=fig3, f4=fig4)
# run the application
if __name__ == "__main__":
app.run(debug=True, host='0.0.0.0')