-
Notifications
You must be signed in to change notification settings - Fork 2
/
app.py
75 lines (49 loc) · 1.55 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
from flask import Flask, render_template, request, redirect
app = Flask(__name__)
@app.route("/", methods=("GET", "POST"))
def index():
if request.method == "POST":
# TODO: create sheets-user-api.py
# return signin_user(request.form["emailInput"])
return redirect("/thank-you")
return render_template("home.html")
@app.route("/create")
def create():
return "Create"
@app.route("/read")
def read():
return "Read"
@app.route("/update")
def update():
return "Update"
@app.route("/delete")
def delete():
return "Delete"
@app.route("/thank-you")
def success_page():
return render_template("thank-you.html")
@app.route("/register", methods=("GET", "POST"))
def register_page():
if request.method == "POST":
# TODO: Understand why we were extracting these variables
# firstName = request.form["firstName"]
# lastName = request.form["lastName"]
# email = request.form["email"]
# major = request.form["major"]
# year = request.form["year"]
# username = firstName + lastName
return redirect("/thank-you") # render_template("thank-you.html")
return render_template("register.html")
@app.route("/login")
def uci_signin():
return "UCI login failed"
@app.route("/logout")
def logout():
# TODO: Fix Login status so users can sign-in with UCI account
return "UCI logout failed"
@app.errorhandler(404)
def page_not_found(err):
# note that we set the 404 status explicitly
return str(err), 404
if __name__ == "__main__":
app.run()