塔架/路线 url_for() 在模板内改变了吗?

发布于 2024-08-26 09:58:11 字数 438 浏览 5 评论 0原文

我收到错误:

GenerationException: url_for could not generate URL. Called with args: () {}

从 mako 模板的这一行:

<p>Your url is ${h.url_for()}</p>

在我的 helpers.py 中,我确实有:

from routes import url_for

查看 Routes-1.12.1-py2.6.egg/routes/util.py,我似乎去 它调用 _screenargs() 的行是错误的。

这是 Pylons 书中的简单功能。我做错了什么愚蠢的事?有新的 url_current() 吗?在哪里?

I'm getting an error:

GenerationException: url_for could not generate URL. Called with args: () {}

from this line of a mako template:

<p>Your url is ${h.url_for()}</p>

Over in my helpers.py, I do have:

from routes import url_for

Looking at the Routes-1.12.1-py2.6.egg/routes/util.py, I seem to go
wrong about line it calls _screenargs().

This is simple functionality from the Pylons book. What silly thing am I doing wrong? Was there a new url_current()? Where?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别把无礼当个性 2024-09-02 09:58:11

我不知道 url_for() (无参数)是否合法,但如果它是合法的,这就是您所说的“url_current”,我相信 新方法是使用 url 对象,调用其方法 url.current()

I didn't know url_for() (no arguments) was ever legal, but if it was and this is what you're referring to as "url_current", I believe the new approach is to use the url object, calling a method on it as url.current().

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文