Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@app.route('/')
@app.route('/index', methods=['GET','POST'])
def index():
form_login = LoginForm()
if form_login.validate_on_submit():
user = User.query.filter_by(username=form_login.username.data).first()
if user:
login_user(user)
flash('logged in successfully as {}.'.format(user.username))
next_page = request.args.get('next')
return redirect(next_page or url_for('index'))
flash('Incorrect username or password', 'error')
print("AQUI ESTA O PROBLEMA")
return render_template('index.html', form=form_login)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment