V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
luofan004
V2EX  ›  问与答

flask request

  •  
  •   luofan004 · Oct 25, 2018 · 1448 views
    This topic created in 2742 days ago, the information mentioned may be changed or developed.
    大佬些,我用 flask 的时候感觉老代码 if else 判断逻辑太多,想在 blueprint 注册同名函数,然后通过 flask 的 before_request 把对应的老的 url 请求的 endpoint 直接更改为 蓝图的 endpoint,即 blue.func , 然后让这个请求直接运行蓝图里面对应的函数,但是 request 对象不允许直接赋值 endpoint 属性(注:我不想用 redirect ( url_for)重定向,想让用户 0 感知, 跟以前一样),求大佬指点
    luofan004
        1
    luofan004  
    OP
       Oct 25, 2018
    已解决~~
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3257 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 13:50 · PVG 21:50 · LAX 06:50 · JFK 09:50
    ♥ Do have faith in what you're doing.