-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
123 lines (86 loc) · 2.88 KB
/
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
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
from flask import Flask, render_template, send_file, request
from data import data
from stu_data import stu_data
from classdata import classdata
app = Flask(__name__)
@app.route("/")
def home():
return render_template("home.html")
@app.route("/student_dash", methods=["POST", "GET"])
def student_dash():
if request.method == "POST":
print(request.form)
return render_template("student/student_success.html")
else:
return render_template("student/student.html")
@app.route("/embed")
def embed():
return render_template("officer/embed.html")
@app.route("/download")
def downloadFile():
path = "static/assets/Correlations.pdf"
return send_file(path, as_attachment=True)
@app.route("/get_graph_data")
def get_graph_data():
return send_file("static/data.csv")
@app.route("/get_class_data")
def get_class_data():
return classdata
@app.route("/performance/detailed")
def detailed_graphs():
return render_template("officer/detailed.html")
@app.route("/performance/get_stu_data")
def get_stu_data():
return stu_data
@app.route("/performance/<school>")
def school_wise(school):
return render_template("officer/school.html", school=school)
@app.route("/performance/<school>/get_school_graph_data")
def school_wise_graph(school):
data = stu_data[school]
return {
"girls": {
"height": data[0],
"weight": data[1],
},
"boys": {"height": data[2], "weight": data[3]},
}
@app.route("/school_dash")
def school_dash():
return render_template("school/school_dash.html")
@app.route("/public")
def public():
return render_template("officer/detailed.html")
@app.route("/performance")
def performance():
return render_template("officer/performance.html")
@app.route("/upload_menu", methods=["POST", "GET"])
def upload_menu():
if request.method == "POST":
print(request.form)
return render_template("school/upload_menu_success.html")
else:
return render_template("school/upload_menu.html")
@app.route("/reg_student", methods=["POST", "GET"])
def reg_student():
if request.method == "POST":
print(request.form)
return render_template("school/reg_student_success.html")
else:
return render_template("school/reg_student.html")
@app.route("/upload_hdata", methods=["POST", "GET"])
def upload_data():
if request.method == "POST":
print(request.form)
return render_template("school/upload_hdata_success.html")
else:
return render_template("school/upload_hdata.html")
@app.route("/upload_attendance", methods=["POST", "GET"])
def upload_attendance():
if request.method == "POST":
print(request.form)
return render_template("school/upload_attendance_success.html")
else:
return render_template("school/upload_attendance.html")
if __name__ == "__main__":
app.run(debug=True)