-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
27 lines (22 loc) · 822 Bytes
/
app.py
File metadata and controls
27 lines (22 loc) · 822 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
from flask import Flask, render_template, request, redirect
app=Flask(__name__)
@app.route('/home')
def index():
fruits=['apple','banana','orange']
return render_template('home.html', fruits=fruits)
@app.route('/')
def home():
return render_template('index.html')
@app.route('/login', methods=["post","get"])
def login():
error= None
if request.method=="POST":
if request.form['email']!="varunbheemaiah9@gmail.com" or request.form['password']!="donkeykong":
error="Email or Password incorrect"
else:
return redirect("/home")
return render_template("login.html", error=error)
return render_template('login.html')
if __name__=='__main__':
app.jinja_env.globals.update(chr=chr)
app.run(host="0.0.0.0", port=8000, debug=True, threaded=True)