<s> """<STR_LIT>""" <EOL> from flask import Blueprint , render_template <EOL> from flask import url_for , session , redirect , request <EOL> from website . account . models import User <EOL> from website . account . forms import LoginForm <EOL> from flask . ext . login import login_required , logout_user , login_user <EOL> account = Blueprint ( '<STR_LIT>' , __name__ , <EOL> template_folder = '<STR_LIT>' ) <EOL> @ account . route ( '<STR_LIT>' , methods = [ '<STR_LIT:GET>' , '<STR_LIT:POST>' ] ) <EOL> def login ( ) : <EOL> form = LoginForm ( ) <EOL> if form . validate_on_submit ( ) : <EOL> user = User . query_filter_by ( username = form . account . data ) <EOL> login_user ( user ) <EOL> return redirect ( request . args . get ( "<STR_LIT>" ) or url_for ( '<STR_LIT:default>' ) ) <EOL> return render_template ( '<STR_LIT>' , form = form ) <EOL> @ account . route ( '<STR_LIT>' ) <EOL> @ login_required <EOL> def logout ( ) : <EOL> logout_user ( ) <EOL> session . clear ( ) <EOL> return redirect ( url_for ( "<STR_LIT>" ) ) </s>
