I'm working on a blogging application, and trying to made just a simple RSS feed system function. However, I'm running into an odd bug that doesn't make a lot of sense to me. I understand what's likely going on, but I don't understand why. My RSS Feed class is below:
class RSSFeed(Feed):
title = settings.BLOG_NAME
description = "Recent Posts"
def items(self):
return Story.objects.all().order_by('-created')[:10]
def link(self, obj):
return obj.get_absolute_url()
However I received the following error (full stack trace at http://dpaste.com/82510/):
AttributeError: 'NoneType' object has no attribute 'startswith'
That leads me to believe that it's not receiving any objects whatsoever. However, I can drop to a shell and grab those Story objects, and I can iterate through them returning the absolute url without any problems. So it would seem both portions of the Feed work, just not when it's in feed form. Furthermore, I added some logging, and can confirm that the items function is never entered when visiting the feeds link. I'm hoping I'm just overlooking something simple. Thanks in advance for any/all help.