Iterational commit.
This commit is contained in:
parent
16e5fa891c
commit
a408fb003b
1 changed files with 4 additions and 1 deletions
5
app.py
5
app.py
|
@ -4,7 +4,10 @@ app = Flask(__name__)
|
||||||
@app.route('/login', methods=['GET', 'POST'])
|
@app.route('/login', methods=['GET', 'POST'])
|
||||||
def login():
|
def login():
|
||||||
if(request.method == 'POST'):
|
if(request.method == 'POST'):
|
||||||
return render_template('')
|
if request.form['username'] != 'admin' or request.form['password'] != 'admin':
|
||||||
|
error = 'Invalid Credentials. Please try again.'
|
||||||
|
else:
|
||||||
|
return redirect(url_for('home'))
|
||||||
elif(request.method == 'GET'):
|
elif(request.method == 'GET'):
|
||||||
return render_template('login.html', error=None)
|
return render_template('login.html', error=None)
|
||||||
return 'ERROR: Invalid method.'
|
return 'ERROR: Invalid method.'
|
||||||
|
|
Reference in a new issue