2017-02-16 31 views
0

猎鹰通常具有优秀的视野。这很奇怪的是猎鹰在Python看到这两个途径相互冲突:蟒蛇猎鹰的不合理路线冲突错误

app.add_route('/verifications/{template}/{email}', code_generation_resource) 
app.add_route('/verifications/{email}/code/{code}', code_verification_resource) 

错误消息:

ValueError: The URI template for this route conflicts with another route's template.

我可以很容易地解决它,但我不知道他们为什么发生冲突。

回答

0

这是因为您使用的是相同的基本路径。 如果您在falcon PATH中添加变量,它只会检查基础。

+0

在第二条路径中有'/ code /',它是路径的静态部分,应该使其不同。 我有这些路线没有冲突: 'app.add_route('/ students/{username}',student.Resource())' AND 'app.add_route('/ students/{username}/cvs/{filename }',cv.Resource())'。 为什么问题中的人相互冲突? – Sincere