首页 > 其他 > 详细

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

时间:2020-06-11 16:11:54      阅读:30      评论:0      收藏:0      [点我收藏+]

 

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

 

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

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

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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!