def show_uploads():
uploads = os.listdir(os.path.join(app.root_path, app.config['UPLOAD_FOLDER']))
uploads.remove('.gitignore')
# sorts uploads by time last modified, which should always be the same as time uploaded
uploads.sort(key=lambda filename: os.stat(os.path.join(app.root_path, app.config['UPLOAD_FOLDER'], filename)).st_mtime)
return utils.render_with_navbar("upload/uploads.html", uploads=uploads[::-1])
评论列表
文章目录