def home(): form = loginform() if request.method == 'POST': if request.form['action'] == 'Login' and form.validate_on_submit(): email = form.email.data.lower() password = form.password.data #validate password and email if verifylogin(email,password): #flash('Login Success','flashok') return redirect(url_for('user')) else: flash('Email and/or password is not found','error') elif request.form['action'] == 'Register': return redirect(url_for('register')) else: flash('Required field(s) are not entered','flasherror') return render_template('submit.html', form=form)
def home(): form = loginform() if request.method == 'POST': if request.form['action'] == 'Login' and form.validate_on_submit(): email = form.email.data.lower() password = form.password.data #validate password and email if verifylogin(email,password): flash('Login Success','flashok') return redirect(url_for('user')) else: flash('Email and/or password is not found','error') elif request.form['action'] == 'Register': return redirect(url_for('register')) else: flash('Required field(s) are not entered','flasherror') return render_template('submit.html', form=form)
def loging(): #redirect to login page! form = loginform() return render_template('submit.html',form=form)