|
FeedsSetup
How-to setup RSS/Atom feeds
(DEPRECATED) MOVED TO http://django-diario.googlecode.com/svn/trunk/docs/syndication.txt RSS/Atom Feeds ConfigurationFor configure your blog feeds, customize urls.py of your project as follow in example below: ...
from diario.feeds import RssEntriesFeed, AtomEntriesFeed
...
entries_feeds = {
'rss': RssEntriesFeed,
'atom': AtomEntriesFeed,
}
urlpatterns = patterns(
...
(r'^blog/(?P<url>(rss|atom))/$', 'django.contrib.syndication.views.feed', {'feed_dict': entries_feeds}),
)With configuration above, the URLs blog feeds is like below: Entries by tag feedsIf you have django-tagging installed and uses him in your project, you can configure feeds of entries separated by tag: ...
from diario.feeds import RssEntriesByTagFeed, AtomEntriesByTagFeed
...
entries_by_tag_feeds = {
'rss': RssEntriesByTagFeed,
'atom': AtomEntriesByTagFeed,
}
urlpatterns = patterns(
...
(r'^blog/tag/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': entries_by_tag_feeds}),
)and access the feeds like below: django-diario have a view for more flexible feeds URL: (r'^blog/tag/(?P<tag>[^/]+)/(?P<slug>(rss|atom))/$', 'diario.views.syndication.feed', {'feed_dict': entries_by_tag_feeds}),With the pattern above you now have URLs like this: For more information, see syndication feed framework. |
Sign in to add a comment