Hello Thomas, Le 18/04/2012 22:37, Thomas Petazzoni a écrit : > Le Wed, 18 Apr 2012 22:19:21 +0200, > Thomas Petazzoni <thomas.petazz...@enix.org> a écrit : > >> Since 1.2, the declaration for the RSS feed url has slightly changed, >> and the old way is no longer available in Django 1.4. So, switch to >> the new way. >> >> Signed-off-by: Thomas Petazzoni <thomas.petazz...@enix.org> >> --- >> www/urls.py | 9 ++------- >> 1 files changed, 2 insertions(+), 7 deletions(-) > > Unfortunately, it doesn't work really nicely due to the usage of > django.contrib.gis.feeds with Django 1.2 (but it works fine in Django > 1.4). Django 1.2 complains when parsing: > > + url(r'^feeds/(?P<url>.*)/$', MapsFeed(), name='rss-feed'), > > and says that __init__() takes 3 arguments and only one was provided (I > guess it's the constructor of MapsFeed). > > On the dev.m.o instance, I have temporarily worked-around this by > applying the following change: > > -from django.contrib.gis.feeds import Feed > +# from django.contrib.gis.feeds import Feed > +from django.contrib.syndication.views import Feed > > Étienne, do you know how to fix this problem to make the code Django > 1.2 and 1.4 compatible?
The only way I am thinking of is to test Django version. Something like: import django assert django.VERSION[0] == 1 and django.VERSION[1] >= 2 if django.VERSION[1] == 2: from django.contrib.syndication.views import Feed else: from django.contrib.gis.feeds import Feed -- Étienne Loks