[英]BuildError: Could not build url for endpoint 'user' with values ['nickname']. Did you forget to specify values ['page', 'username']?
[英]Flask End Point Not Building: Could not build url for endpoint 'edittenant'. Did you forget to specify values
我收到这个错误
Could not build url for endpoint 'edittenant'. Did you forget to specify values ['user_id']?
我的代码看起来很简单。 也许我错过了一些简单的东西? 但只有当我添加render_template
function 时,我才会收到错误。
@app.route("/edittenant/<int:user_id>", methods=['GET', 'POST'])
def edittenant(user_id):
# tenant = Tenant.query.get(user_id) <-- this works
# return str(tenant.id) + str(tenant.name) <-- this works too
return render_template("/house/edittenant.html") <-- this throws the building error
这是一个神社问题,而不是 flask 问题,并且与表单中的url_for
function 有关。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.