0

I have a Django website, recently I added the RSS feed. I noticed that the resulting feed is showing the ip of the hosting instead of my domains:

<link>http://12.324.6.789/articles/</link>

Here below the code

from django.contrib.syndication.views import Feed 
from django.template.defaultfilters import truncatewords 
from django.urls import reverse 
from django.utils.feedgenerator import Atom1Feed 

class blogFeed(Feed): 
    title = "BLOGTITLE"
    link = "/articles/"
    description = "RSS feed of BLOG"

    def items(self): 
        return ArticlePage.objects.live().order_by('-date_display')[:10]

    def item_title(self, item): 
        return item.title 
        

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

and this route

# RSS route   
    path("rss/", blogFeed(), name ="feed"), 

Any suggestion?

Mao
  • 11
  • 2

1 Answers1

1

I found out that I was missing the domain in the django_site table, so that I added the domain to my list following this reply from another thread.

Then I set the right SITE_ID

https://stackoverflow.com/a/21101910/11442007

Mao
  • 11
  • 2