flask: AttributeError: 'function' object has no attribute 'route'

@detail.route('/detail')
def detail():
    return render('detail/index.html')

如上代码:路由装饰器为detail, 函数名也是 detail 。所以会有这个错

解决办法: 函数名与路由装饰器冲突,修改装饰器名或者修改函数名

原文地址:https://www.cnblogs.com/Frange/p/13093527.html