【发布时间】:2014-03-25 17:08:48
【问题描述】:
我有一个包含代码的视图 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") 时,它起作用了。
看起来它保留了一些端点并且不让我覆盖它。如何删除所有端点以重新开始。
【问题讨论】:
-
你能分享你定义这个视图的整个文件吗?