AssertionError: View function mapping is overwriting an existing endpoint function: admin.main

刚才给views.py文件添加了一个路由地址:

@admin_view.route('/test', methods=["get", "post"])
@login_required
def main():
  return render_template('400_outline.html')

没想到如题错误:AssertionError: View function mapping is overwriting an existing endpoint function: admin.main

我没怎么看错误信息,直接拿着复制百度去了..-_-|||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------以上起因
百度搜索到的 http://www.tuicool.com/articles/NzEbqmj  没想到搜到的知识量还挺多..我原来只是知道怎么用 不知道原理 这个链接 很好的解释了;原来是我的函数名写重了。

----------------------------------------------------------------------------------------------------------------------------------------------------------------------以上百度搜索到的结果

原文地址:https://www.cnblogs.com/aiyr/p/6650691.html