# 图片上传配置
fn = getattr(sys.modules['__main__'], '__file__')
root_path = os.path.abspath(os.path.dirname(fn)) + "/static/upload"
app.config['UPLOADED_PHOTO_DEST'] = root_path
app.config['UPLOADED_PHOTO_ALLOW'] = IMAGES
photos = UploadSet('PHOTO')
configure_uploads(app, photos)
转载于:https://www.cnblogs.com/Jacky-WYQ/p/10915715.html