def login():
form = LoginForm()
if form.validate_on_submit():
flash('Login requested for user {}, remember_me={}'.format(
form.username.data, form.remember_me.data))
return redirect('/index')
return render_template('login.html', title='Sign In', form=form)
def login():
form = LoginForm()
if form.validate_on_submit():
if form.username.data == 'Login' and form.password.data == 'Password':
flash('Вы вошли')
return redirect('/index')
else:
flash('Неверный логин или пароль')
return render_template('login.html', title='Sign In', form=form)