custom route decorator
This question already has an answer here:
def adminRoute(*route_args, **route_kwargs):
def outer(action_function):
@app.route(*route_args, **route_kwargs)
@requiresAdmin
@functools.wraps(action_function)
def inner(*f_args, **f_kwargs):
return action_function(f_args, f_kwargs)
return inner
return outer
链接地址: http://www.djcxy.com/p/23818.html
上一篇: 将相同的方法传递给多个装饰器函数
下一篇: 自定义路由装饰器