diff gpp/urls.py @ 176:b7ac381996e8

Implement ticket #59; update RSS feeds for Django 1.2.
author Brian Neal <bgneal@gmail.com>
date Thu, 11 Mar 2010 02:34:07 +0000
parents 6f14970b103a
children 9b63ad1f2ad2
line wrap: on
line diff
--- a/gpp/urls.py	Wed Mar 03 04:09:42 2010 +0000
+++ b/gpp/urls.py	Thu Mar 11 02:34:07 2010 +0000
@@ -1,8 +1,6 @@
 from django.conf.urls.defaults import *
 from django.conf import settings
 from django.contrib import admin
-from django.views.decorators.cache import cache_page
-from django.contrib.syndication.views import feed as syndication_feed
 
 from news.feeds import LatestNewsFeed
 from forums.feeds import ForumsFeed
@@ -10,11 +8,6 @@
 
 admin.autodiscover()
 
-feeds = {
-   'news': LatestNewsFeed,
-   'forums': ForumsFeed,
-}
-
 urlpatterns = patterns('',
    url(r'^$', 'views.home', name='home'),
    (r'^admin/doc/', include('django.contrib.admindocs.urls')),
@@ -26,10 +19,16 @@
    (r'^core/', include('core.urls')),
    (r'^donations/', include('donations.urls')),
    (r'^downloads/', include('downloads.urls')),
-   url(r'^feeds/(?P<url>.*)/$',
-      cache_page(syndication_feed, 60 * 15),
-      {'feed_dict': feeds},
-      'feeds-news'),
+   url(r'^feeds/news/$',
+       LatestNewsFeed(),
+       name='feeds-news'),
+   url(r'^feeds/forums/$',
+       ForumsFeed(),
+       {'forum_slug': None},
+       'feeds-forum_combined'),
+   url(r'^feeds/forums/(?P<forum_slug>[\w\d-]+)/$',
+       ForumsFeed(),
+       name='feeds-forum'),
    (r'^forums/', include('forums.urls')),
    (r'^irc/', include('irc.urls')),
    (r'^links/', include('weblinks.urls')),