from django.contrib.syndication.views import Feed
from django.utils import timezone


class LatestEnteriesFeed(Feed):
    description = "Latest news"

    def items(self):
        now = timezone.now()
        NewsItem = self.news_index.get_newsitem_model()
        newsitem_list = NewsItem.objects.live().order_by('-date').filter(
            newsindex=self.news_index, date__lte=now)[:20]
        return newsitem_list

    def item_link(self, item):
        return item.url()

    def __init__(self, news_index):
        super(LatestEnteriesFeed, self).__init__()
        self.news_index = news_index
        self.title = news_index.title
        self.link = news_index.url

    def item_pubdate(self, item):
        return item.date

from django.contrib.syndication.views import Feed
from django.utils import timezone


class LatestEnteriesFeed(Feed):

    def items(self):
        now = timezone.now()
        NewsItem = self.news_index.get_newsitem_model()
        newsitem_list = NewsItem.objects.live().order_by('-date').filter(
            newsindex=self.news_index, date__lte=now)[:20]
        return newsitem_list

    def item_link(self, item):
        return item.full_url()

    def item_guid(self, item):
        return item.full_url()

    item_guid_is_permalink = True

    def item_pubdate(self, item):
        return item.date

    def __init__(self, news_index):
        super(LatestEnteriesFeed, self).__init__()
        self.news_index = news_index

        self.title = news_index.title
        self.description = news_index.title

        self.link = news_index.full_url
        self.feed_url = self.link + news_index.reverse_subpage('feed')

Add some extra item methods / parameters to LatestEntriesFeed
Add some extra item methods / parameters to LatestEntriesFeed

  from django.contrib.syndication.views import Feed
  from django.utils import timezone
  
  
  class LatestEnteriesFeed(Feed):
-     description = "Latest news"
  
      def items(self):
          now = timezone.now()
          NewsItem = self.news_index.get_newsitem_model()
          newsitem_list = NewsItem.objects.live().order_by('-date').filter(
              newsindex=self.news_index, date__lte=now)[:20]
          return newsitem_list
  
      def item_link(self, item):
-         return item.url()
+         return item.full_url()
+ 
+     def item_guid(self, item):
+         return item.full_url()
+ 
+     item_guid_is_permalink = True
+ 
+     def item_pubdate(self, item):
+         return item.date
  
      def __init__(self, news_index):
          super(LatestEnteriesFeed, self).__init__()
          self.news_index = news_index
+ 
          self.title = news_index.title
-         self.link = news_index.url
+         self.description = news_index.title
  
-     def item_pubdate(self, item):
-         return item.date
+         self.link = news_index.full_url
+         self.feed_url = self.link + news_index.reverse_subpage('feed')
  
Add some extra item methods / parameters to LatestEntriesFeed
## Code Before:
from django.contrib.syndication.views import Feed
from django.utils import timezone


class LatestEnteriesFeed(Feed):
    description = "Latest news"

    def items(self):
        now = timezone.now()
        NewsItem = self.news_index.get_newsitem_model()
        newsitem_list = NewsItem.objects.live().order_by('-date').filter(
            newsindex=self.news_index, date__lte=now)[:20]
        return newsitem_list

    def item_link(self, item):
        return item.url()

    def __init__(self, news_index):
        super(LatestEnteriesFeed, self).__init__()
        self.news_index = news_index
        self.title = news_index.title
        self.link = news_index.url

    def item_pubdate(self, item):
        return item.date

## Instruction:
Add some extra item methods / parameters to LatestEntriesFeed
## Code After:
from django.contrib.syndication.views import Feed
from django.utils import timezone


class LatestEnteriesFeed(Feed):

    def items(self):
        now = timezone.now()
        NewsItem = self.news_index.get_newsitem_model()
        newsitem_list = NewsItem.objects.live().order_by('-date').filter(
            newsindex=self.news_index, date__lte=now)[:20]
        return newsitem_list

    def item_link(self, item):
        return item.full_url()

    def item_guid(self, item):
        return item.full_url()

    item_guid_is_permalink = True

    def item_pubdate(self, item):
        return item.date

    def __init__(self, news_index):
        super(LatestEnteriesFeed, self).__init__()
        self.news_index = news_index

        self.title = news_index.title
        self.description = news_index.title

        self.link = news_index.full_url
        self.feed_url = self.link + news_index.reverse_subpage('feed')
