Django简单的联合示例给出:ImportError,无法导入名称Feed

时间:2010-04-08 18:58:25

标签: django django-syndication

我正在尝试在一个正在运行的项目中设置Django文档中的simple syndication example。但是我得到了一个ImportError,即使我确定我已经完全复制了这个例子。

这是我在feeds.py中的内容:

from django.contrib.syndication.views import Feed 
class LatestEntriesFeed(Feed):
    # etc

这就是我在urls.py中所拥有的:

from election.feeds import LatestEntriesFeed
#... further down, at the appropriate line...
    # RSS feed
    (r'^feed/$', LatestEntriesFeed()),

但是Django说它无法从django.contrib.syndication.views导入Feed类:

ImportError at /feed/
cannot import name Feed
....feeds.py in <module>
from django.contrib.syndication.views import Feed  

有什么想法吗?我很困惑!

1 个答案:

答案 0 :(得分:2)

该文档适用于开发版本。在准备1.2时,饲料变化很大。如果您使用的是1.1,则应使用the 1.1 docs