【发布时间】:2017-11-02 00:30:50
【问题描述】:
即使我有用户名的值,我也会不断收到此错误:
werkzeug.routing.BuildError:无法为端点“main.profile”构建 url。您是否忘记指定值 ['username']?
这是我的代码:
{% for user in users %}
<a href="{{ url_for('.profile', username=user.username) }}">
{{ user.username }} #This work fine, I don't know why the one in the anchor tag doesn't work.
</a>
{% endfor %}
这可能是 werkzeug 中的 BUG 吗?
任何帮助将不胜感激。
【问题讨论】:
-
你不应该转义引号吗?
-
哪些引号? @0TTT0
-
锚标签中的那些
-
我认为这无关紧要,但试过了,确实没有。
-
请将问题更改为更能描述您遇到的问题,例如“werkzeug.routing.BuildError blahblah”