开发者

Django simple syndication example gives: ImportError, cannot import name Feed

I'm trying to set up the simple syndication example from the Django docs, in a working project. But I'm getting an ImportError, even though I'm sure I've copied the example exactly.

Here's what I have in feeds.py:

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

And here's what I have in urls.py:

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

But Django says it can't import the Feed class from django.contrib.syndication.views:

ImportError at /feed/
cannot import name Feed
....feeds.py in <module>
from django.contrib.syndication.views import Feed  开发者_运维知识库

Any ideas? I'm baffled!


That documentation is for the development version. Feeds have changed quite a lot in preparation for 1.2. If you're using 1.1, you should use the 1.1 docs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜