flask url_for 的问题 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
romanxu
V2EX    Flask

flask url_for 的问题

  •  
  •   romanxu 2015-11-04 13:02:52 +08:00 2764 次点击
    这是一个创建于 3697 天前的主题,其中的信息可能已经有所发展或是发生改变。

    @app.route('/album/<slug>')
    def show_album(slug):
    r= get_root_dirs_files()
    try:
    r = r[slug]
    except:
    return 'Album Not Existing'

    return render_template("albums.html", dicts=r) 

    @app.route("/delete/<path:object_name>")
    def delete(object_name):
    obj = storage.get(object_name)
    print obj
    remove('./static/uploads/Pictures/%s' % (obj.name))
    return redirect(url_for('show_album'???))

    delete 函数中, url_for show_album 函数时,里面的参数要怎么填?

    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     3765 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 24ms UTC 04:11 PVG 12:11 LAX 20:11 JFK 23:11
    Do have faith in what you're doing.