塔架/路线 url_for() 在模板内改变了吗?
我收到错误:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道
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 theurl
object, calling a method on it asurl.current()
.