Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve "Could not import django.contrib.syndication.views.feed" error in Django admin?

I've updated my Django version to the latest nightly, and I'm getting the following error in the admin;

Could not import django.contrib.syndication.views.feed.  
View does not exist in module django.contrib.syndication.views.

I had this error in several views too because, indeed, django.contrib.syndication.views.feed was deprecated and has been removed.
I only had to add a

from django.contrib.syndication.views import Feed

with

from django.contrib.syndication.feeds import Feed

Problem is that I can't find any references to django.contrib.syndication.views.feed anywhere, not even in the Django source, so I don't understand where the error is coming from and how to solve it.

The direct source of the error is

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/urlresolvers.py in get_callable, line 100

but I can't find anything there either.

Hoping someone can help!

like image 618
Jasper Kennis Avatar asked Jul 10 '11 17:07

Jasper Kennis


1 Answers

user643511 suggested that the error might be in my own code, not Django. However she didn't point out the real problem (which I understand since I didn't provide the right information). Only after days of digging I found that I had

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

in urls.py. And instead, I had to use

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

Mind the capital F in views.Feed.

So if anyone passes by with similar trouble, check urls.py.

like image 170
Jasper Kennis Avatar answered Nov 15 '22 03:11

Jasper Kennis