#NEWLINE# def create_app( self ) : #NEWLINE# #INDENT# app = Flask ( __name__ ) #NEWLINE# app . secret_key = 'secret' #NEWLINE# @ app . route ( '/ajax/' , methods = ( 'POST' , ) ) #NEWLINE# def ajax_submit( ) : #NEWLINE# #INDENT# form = FooForm ( csrf_enabled = False ) #NEWLINE# if form . validate_on_submit ( ) : #NEWLINE# #INDENT# return jsonify ( name = form . name . data , success = True , errors = None ) #NEWLINE# #UNINDENT# return jsonify ( name = None , errors = form . errors , success = False ) #NEWLINE# #UNINDENT# return self