-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.py
72 lines (50 loc) · 1.67 KB
/
run.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
import sys
from flask import *
import pymongo
from flask_pymongo import PyMongo
app=Flask(__name__)
app.config["MONGO_URI"] = "mongodb://localhost:27017/test"
mongo = PyMongo(app)
@app.route('/',methods=['GET','POST'])
def home():
return render_template("facedetection.html")
@app.route('/managefaces.html',methods=['GET','POST'])
def manage():
return render_template("managefaces.html")
@app.route('/home.html',methods=['GET','POST'])
def basic():
return render_template("home.html")
@app.route('/team.html',methods=['GET','POST'])
def team():
return render_template("team.html")
@app.route('/FinalDocumentation.html',methods=['GET','POST'])
def doc():
return render_template("Final Documentation.html")
@app.route('/signup.html',methods=['GET','POST'])
def signup():
flag=0
if request.method=="POST":
username=request.form['username']
password=request.form['password']
data={'Username':username,
'Password':password}
mongo.db.EEYE_SIgnup.insert_one(data)
flag=1
return redirect(url_for('signin'))
if (flag!=1):
return render_template("signup.html")
@app.route('/signin.html',methods=['GET','POST'])
def signin():
flag=0
if request.method=="POST":
username=request.form['username']
password=request.form['password']
data={'Username':username,'Password':password}
status=mongo.db.EEYE_SIgnup.find_one(data)
if (status!=None):
flag=1
return redirect(url_for('basic'))
if(flag!=1):
return render_template("signin.html")
if __name__=='__main__':
app.run(debug=True)