Answer the question
In order to leave comments, you need to log in
How to implement simple user authorization in a Flask application?
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)
Answer the question
In order to leave comments, you need to log in
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)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question