luofan004
V2EX  ›  问与答

flask request

  •  
  •   luofan004 · Oct 25, 2018 · 1554 views
    This topic created in 2804 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   ·   1228 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 17:17 · PVG 01:17 · LAX 10:17 · JFK 13:17
    ♥ Do have faith in what you're doing.