#NEWLINE# @ user_blueprint . route ( '/register' , methods = [ 'GET' , 'POST' ] ) #NEWLINE# def register( ) : #NEWLINE# #INDENT# form = RegisterForm ( request . form ) #NEWLINE# if form . validate_on_submit ( ) : #NEWLINE# #INDENT# user = User ( email = form . email . data , password = form . password . data ) #NEWLINE# db . session . add ( user ) #NEWLINE# db . session . commit ( ) #NEWLINE# login_user ( user ) #NEWLINE# flash ( 'You registered and are now logged in. Welcome!' , 'success' ) #NEWLINE# return redirect ( url_for ( 'main.home' ) ) #NEWLINE# #UNINDENT# return render_template ( 'user/register.html' , form = form )