I am working on a blog application and am trying to create a simple RSS feed system function. However, I encounter an unusual error that does not make much sense to me. I understand what is happening, but I do not 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 got the following error (full stack trace http://dpaste.com/82510/ ):
AttributeError: 'NoneType' object has no attribute 'startswith'
This makes me think that he does not receive any items at all. However, I can go to the shell and capture those Story objects, and I can iterate over them, returning an absolute URL without any problems. Thus, it would seem that both parts of the feed work, and not just in the form of a feed. In addition, I have added some logging and I can confirm that the item function is never entered when visiting channel links. I hope I just apologize. Thanks in advance for any / any help.
source
share