-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
40 lines (25 loc) · 789 Bytes
/
app.py
File metadata and controls
40 lines (25 loc) · 789 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
32
33
34
35
36
37
38
39
40
from flask import Flask, render_template, request, redirect
app = Flask(__name__)
# @app.route("/")
# def index():
# return render_template("pages/index.html")
@app.route("/")
def hello_world():
return render_template("pages/home.html")
@app.route("/login")
def login():
return render_template("pages/login.html")
@app.route("/register")
def register():
return render_template("pages/register.html")
@app.route("/dologin", methods=["POST"])
def do_login():
username = request.form["username"]
password = request.form["password"]
if username == "apsara" and password == "apsara123":
redirect("/")
return "you have been logged in successfully"
else:
redirect("/login")
if __name__ == "__main__":
app.run(debug=True)