Changeset - 6a2918c288c2
[Not reviewed]
0 2 0
Bradley Kuhn (bkuhn) - 10 years ago 2014-07-14 14:49:29
bkuhn@ebb.org
In Django 1.2, feed_dict was deprecated.

Therefore, change this to use the method explained at:

https://docs.djangoproject.com/en/dev/releases/1.2/#feed-in-django-contrib-syndication-feeds
2 files changed with 3 insertions and 10 deletions:
0 comments (0 inline, 0 general)
www/conservancy/feeds.py
Show inline comments
...
 
@@ -237,15 +237,8 @@ class BlogFeed(ConservancyFeedBase):
 

	
 
        return queryset.order_by('-pub_date')[:10]
 

	
 

	
 
feed_dict = {
 
    'blog': BlogFeed,
 
    'news': PressReleaseFeed,
 
    'omnibus': OmnibusFeed,
 
#    'event-media': RecentEventMediaFeed,
 
}
 
# make each feed know its canonical url
 

	
 
for k, v in feed_dict.items():
 
    v.get_absolute_url = '/feeds/%s/' % k
 

	
www/conservancy/urls.py
Show inline comments
...
 
@@ -27,11 +27,11 @@ admin.autodiscover()
 

	
 
urlpatterns = patterns('',
 
    (r'^admin/doc/', include('django.contrib.admindocs.urls')),
 
    (r'^admin/(.*)', admin.site.urls),
 
    (r'^$', 'conservancy.frontpage.view'),
 
    (r'^feeds/(?P<url>.*)/?$', 'django.contrib.syndication.views.Feed',
 
     {'feed_dict': feed_dict}),
 
    (r'^feeds/blog/?$', 'django.contrib.syndication.views.Feed', BlogFeed()),
 
    (r'^feeds/news/?$', 'django.contrib.syndication.views.Feed', PressReleaseFeed()),
 
    (r'^feeds/omnibus/?$', 'django.contrib.syndication.views.Feed', OmnibusFeed()),
 
    (r'^feeds/?$', 'conservancy.feeds.view'),
 
    (r'^news(/|$)', include('conservancy.apps.news.urls')),
 
    (r'^blog(/|$)', include('conservancy.apps.blog.urls')),
 
)
0 comments (0 inline, 0 general)