<s> from flask import Flask , render_template , request <EOL> from flaskext . wtf import Form , FileField , FieldList , required <EOL> class FileUploadForm ( Form ) : <EOL> uploads = FieldList ( FileField ( ) ) <EOL> DEBUG = True <EOL> SECRET_KEY = '<STR_LIT>' <EOL> app = Flask ( __name__ ) <EOL> app . config . from_object ( __name__ ) <EOL> @ app . route ( "<STR_LIT:/>" , methods = ( "<STR_LIT:GET>" , "<STR_LIT:POST>" , ) ) <EOL> def index ( ) : <EOL> form = FileUploadForm ( ) <EOL> for i in xrange ( <NUM_LIT:5> ) : <EOL> form . uploads . append_entry ( ) <EOL> filedata = [ ] <EOL> if form . validate_on_submit ( ) : <EOL> for upload in form . uploads . entries : <EOL> filedata . append ( upload ) <EOL> return render_template ( "<STR_LIT>" , <EOL> form = form , <EOL> filedata = filedata ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> app . run ( ) </s>
