-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.py
More file actions
53 lines (45 loc) · 1.33 KB
/
app.py
File metadata and controls
53 lines (45 loc) · 1.33 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
from flask import Flask,render_template
import os
from graph import h
from gatepass import gatepass
from flask_sqlalchemy import SQLAlchemy
from attendance import attendance
from issues import issues
from backlogs import backlogs
basedir = os.path.abspath(os.path.dirname(__file__))
app=Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI']='sqlite:///'+os.path.join(basedir,'data.sqllite')
app.config['SQLALCHEMY_TRACK_MODIFICATIONS']=False
db=SQLAlchemy(app)
class Puppy(db.Model):
__tablename__='puppies'
id = db.Column(db.Integer,primary_key=True)
name=db.Column(db.Text)
age=db.Column(db.Integer)
def __init__(self,name,age):
self.name=name
self.age=age
def __repr__(self):
return f"Puppy {self.name} is {self.age} yearsr old"
@app.route('/cgpa')
def chart():
graph1=h()
return render_template('graph.html',graph1=graph1)
@app.route('/gatepass')
def chart2():
graph2=gatepass()
return render_template('gatepass.html',graph2=graph2)
@app.route('/attendance')
def chart3():
graph3=attendance()
return render_template('attendance.html',graph3=graph3)
@app.route('/issues')
def chart4():
graph4=issues()
return render_template('issues.html',graph4=graph4)
@app.route('/backlogs')
def chart5():
graph5=backlogs()
return render_template('backlogs.html',graph5=graph5)
if __name__=="__main__":
app.run(debug=True,port=8080)