syndication feed framework - how to reverse the urls?

11 views
Skip to first unread message

anentropic

unread,
Sep 29, 2009, 11:57:27 AM9/29/09
to Django users
I've been setting up feeds using the syndication feed framework.

I have a line like this in my urls.py:

(r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed',
{'feed_dict': feeds}),


How do I avoid hard-coding the feed urls into my template?

I want to {% url django.contrib.syndication.views.feed.feed_name
params %} in my html templates to generate the <link rel="alternate"/>
tags

...but it doesn't work for me (should it?)

anentropic

unread,
Sep 30, 2009, 10:23:07 AM9/30/09
to Django users
Anyone? Is it possible to reverse those urls?

The feeds framework implementation seems like a dirty hack to urls.py
(but otherwise works great!)

anentropic

unread,
Oct 5, 2009, 6:31:14 AM10/5/09
to Django users
So I just have to hard-code the feed urls in my templates?

Russell Keith-Magee

unread,
Oct 5, 2009, 7:09:04 AM10/5/09
to django...@googlegroups.com
On Mon, Oct 5, 2009 at 6:31 PM, anentropic <pa...@blues.co.nz> wrote:
>
> So I just have to hard-code the feed urls in my templates?

In short, yes.

The feeds framework predates the introduction of named URLs in Django,
and as a result the original implementation didn't include named urls.
The feeds framework is badly in need of a rewrite, and this is one of
the issues that needs to be addressed.

Yours,
Russ Magee %-)

anentropic

unread,
Oct 6, 2009, 12:48:08 PM10/6/09
to Django users
ok, thanks!

On Oct 5, 12:09 pm, Russell Keith-Magee <freakboy3...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages