-
Notifications
You must be signed in to change notification settings - Fork 7
/
app.py
40 lines (27 loc) · 1006 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
from flask import Flask, render_template, url_for, request, redirect, flash
from register import register_yourself
from mark_attendance import mark_your_attendance
app = Flask(__name__)
app.secret_key = 'my secret key' #Nothing important, type anything, just for flashing
@app.route('/')
def home():
return render_template("index.html")
@app.route('/', methods=['POST'])
def home_after_registration():
id = request.form['Student_id']
register_yourself(id)
flash("Registration Successful")
return render_template("index.html")
@app.route('/registration', methods=['GET', 'POST'])
def registration():
return render_template("register.html")
@app.route('/attendance', methods=['GET', 'POST'])
def attendance():
marked = mark_your_attendance()
if(marked == True):
flash("Attendence Marked Successfully")
else:
flash("You are not registered yet")
return render_template("index.html")
if __name__ == '__main__':
app.run(debug = True)