@home_routes.route('/logout/')
@login_required
def logout_view():
 record_user_login_logout('user_logout', login.current_user)
 login.logout_user()
 return redirect(url_for('.index'))

@ home_routes . route ( '/logout/' ) @ login_required def logout_view ( ) : record_user_login_logout ( 'user_logout' , login . current_user ) login . logout_user ( ) return redirect ( url_for ( '.index' ) )
logout method which redirect to index .