#NEWLINE# @ admin . route ( '/in' , methods = [ 'GET' , 'POST' ] ) #NEWLINE# def login( ) : #NEWLINE# #INDENT# form = LoginForm ( ) #NEWLINE# if form . validate_on_submit ( ) : #NEWLINE# #INDENT# username = form . username . data #NEWLINE# password = form . password . data #NEWLINE# if User . password_match ( username , password ) : #NEWLINE# #INDENT# session [ 'username' ] = username #NEWLINE# session [ 'logged_in' ] = True #NEWLINE# return redirect ( url_for ( 'pastes.index' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# flash ( 'Incorrect username/password' , 'error' ) #NEWLINE# #UNINDENT# #UNINDENT# return render_template ( 'login.html' , form = form )