def login():
form=logi()
if form.validate_on_submit():
username=form.username.data
password=form.password.data
try:
me=User.query.filter_by(user=username).first()
if me.password==password:
session['username']=username
return redirect(url_for('index'))
else:
flash('??????????')
return render_template('login.html',form=form)
except:
flash('??????')
return render_template('login.html',form=form)
return render_template('login.html',form=form)
评论列表
文章目录