-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
31 lines (22 loc) · 683 Bytes
/
app.py
File metadata and controls
31 lines (22 loc) · 683 Bytes
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
import csv
import os
from flask import Flask
from flask import render_template
from services.ReportFetchService import fetch_files
from settings import DATA_STATIC
app = Flask(__name__)
static_dir = os.path
@app.route("/")
def index():
with open(os.path.join(DATA_STATIC, "fyp.csv")) as file:
dList = []
reader = csv.DictReader(file)
for row in reader:
dList.append(row)
return render_template("index.html", data=dList)
@app.route("/view/<roll>")
def view_content(roll):
report_data = fetch_files(roll.split("&"))
return render_template("details.html", data=report_data)
if __name__ == "__main__":
app.run(debug=True)