Django RSS Feed has domain set to example.com
I am able to get an output for 开发者_Go百科the rss feed but the domain in the item link is http://example.com instead of the domain that I used in Feed.link (http://www.mydomain.com/blog). What do I need to do to get "mydomain.com" instead of "example.com"?
Below is the generated rss feed:
<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title>MyDomain Blog</title>
<link>http://www.mydomain.com/blog</link>
<description>insights and new developments in creating Pushstack</description>
<atom:link href="http://example.com/blog/rss/" rel="self"></atom:link>
<language>en-us</language>
<lastBuildDate>Mon, 31 Jan 2011 19:41:42 -0000</lastBuildDate>
<item>
<title>Example</title>
<link>http://example.com/blog/example</link>
<description></description>
<guid>http://example.com/blog/example</guid>
</item>
</channel>
</rss>
Also, in the title of the browser (OS X Chrome) it says, "NameError at /blog/rss/". Not sure if that is something that always shows up or if something else is wrong.
example.com
is the domain that is automatically inserted into the database via the Sites framework.
You can edit the site in the admin: http://yourserver.com/admin/sites/site/
That's correct. You can also update it directly from the DDBB from "django_site" table, in case you are not using the admin.
Regards, Martin
The atom:link value defaults to the information in the Sites framework, but you can override it by setting a feed_link property in your feed class, eg:
feed_link = "http://www.mydomain.com/blog/rss"
精彩评论