-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
84 lines (61 loc) · 1.88 KB
/
app.py
File metadata and controls
84 lines (61 loc) · 1.88 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
from flask import Flask, render_template, request, redirect, url_for, session
import engine
from data import Data
app = Flask(__name__, static_url_path='/static')
app.debug = True
app.secret_key = "Nothing"
@app.route("/")
def IndexPage():
return render_template('index.html')
@app.route("/forcast")
def forcastPage():
return render_template('forcast.html')
@app.route("/Login")
def Login():
return render_template('Login.html')
@app.route("/DashBoard")
def DashBoard():
return render_template('dashboard.html')
rsh = ''
@app.route('/MapData', methods=['POST'])
def getmessage():
crowd = request.form['Crowd']
traffic = request.form['Traffic']
greenery = request.form['Greenery']
lat = request.form['lati']
long = request.form['longi']
distance = request.form['distance']
print(lat, long)
print(crowd, traffic, greenery)
global rsh
rsh, islaps = engine.main(lat, long, distance, crowd, traffic, greenery)
if 'laps' in islaps:
return {'map_name': rsh+'.html', 'warning': islaps['lap']}
else:
return {'map_name': rsh+'.html'}
@app.route('/FeedBack', methods=['POST'])
def FeedBack():
OverallFeed = request.form['OverallFeed']
Safety = request.form['Safety']
Noise = request.form['Noise']
Greenery = request.form['Greenery']
Crowd = request.form['Crowd']
print(Crowd, Noise)
engine.submit(OverallFeed, Crowd, Noise, Safety, Greenery, rsh)
return "Test"
@app.route('/future', methods=['POST'])
def forecast():
dt = Data()
start = {
'long': 77.1166061999999999, # lon, ,
'lat': 28.6320032 # lat
}
hours = request.form['distance']
print(hours)
dt.process_forecast_data(start['lat'], start['long'], hours)
return "Test"
@app.errorhandler(404)
def error404(error):
return render_template('404.html'), 404
if __name__ == "__main__":
app.run()