反转 feed url 时出现问题
我正在使用开发版本。当我尝试反向查找我的 feed 的 URL 时,出现以下错误。
有人可以帮忙吗?
谢谢 konstantin
在我的 urls.py:
...
url(r'^f/blog/$', 'django.contrib.syndication.views.Feed', BlogFeed(), name='blog-feed'),
...
在我的模板中:
...
{% url blog-feed %}
...
错误:
...
Caught AttributeError while rendering: 'BlogFeed' object has no attribute 'keys'
...
I am using the development version. I get the error below when I try to reverse lookup my feed's URL.
Can anyone help please?
thanks
konstantin
in my urls.py:
...
url(r'^f/blog/
in my template:
...
{% url blog-feed %}
...
the error:
...
Caught AttributeError while rendering: 'BlogFeed' object has no attribute 'keys'
...
, 'django.contrib.syndication.views.Feed', BlogFeed(), name='blog-feed'),
...
in my template:
the error:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您的 BlogFeed 类是基于类的视图,我认为您不需要 'django.contrib.synmination.views.Feed' 部分...您的 BlogFeed 应该是它的子类。 (django 文档)
If your BlogFeed class is the class based view, I don't think you need the 'django.contrib.syndication.views.Feed' part... your BlogFeed should be a subclass of that. (django docs)
url 的第三个参数应该是一个字典。我不知道你为什么要上课。
也许你想做的是,
The third argument to url should be a dictionary. I'm not sure why you've got a class.
Maybe what you are trying to do is,