コード例 #1
0
ファイル: bread.py プロジェクト: Piyu31/Friday25SigunpLogin
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)
コード例 #2
0
ファイル: bread.py プロジェクト: zacdemi/simplelogin
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)
コード例 #3
0
ファイル: bread.py プロジェクト: Piyu31/Friday25SigunpLogin
def loging():
#redirect to login page!
    form = loginform()
    return render_template('submit.html',form=form)