我有一个视图python文件,其代码为:
@app.route('/')
def index():
page = """
<html>
<head>
</head>
.....
...
</html>
我对此文件进行了一些更改,这些更改只是导入render_template
等正常更改。我能够在localhost
中使用foreman start命令查看html文件。但是在我之前提到的一些变化之后,当我再次开始使用工头开始时,我收到错误 - " View function mapping is overwriting an existing endpoint function: index "
然而,当我使用@app.route('/',endpoint ="new")
时,它起作用了。
看起来它保留了一些端点而不让我覆盖它。如何删除所有端点以重新开始。
答案 0 :(得分:0)
确保您没有两条具有相同URI的路线。