tags:

views:

340

answers:

1

I have an RSS feed that I'm setting up on my new site using Django. Currently I have an RSS feed being served per user, rather than just one big nasty, global RSS feed. The only problem is that the links that are returned by the RSS feed have the completely wrong domain name in the links. The end path is perfectly correct, and the get_absolute_url method seems to work everything else in my applications, just not here. You would think I'd be getting the default "www.example.com/item/item_id", but instead I get another domain that's hosted on this server. At first I was thinking it was just pulling the hostname of the server, but it's not. It's also not pulling what the SITE_ID is set to either. Django docs say that the feeds will pull the domain from the SITE_ID setting, but it's just not. I've grepped my entire application for the domain it's pulling, and found absolutely nothing.

I'm sure I'm missing something simple, but for the life of me I can't deduce it. The domain it's building the URLs with simply doesn't exist anywhere in the application's code or database. So where on Earth is it coming up with the domain?

UPDATE:

ServerName in Apache was set to the domain that I was seeing being used by the RSS Feeds to build the URLs. I changed that, and restarted Apached, wrong domain still in use. Any other ideas on how to force Django to use the right domain?

+3  A: 

May be it's coming from environment variables? Try:

export | grep your.mistery.domain

see if that comes up with anything, do that as the same user under which you are running your Django apps.

You know you can always implement your item_link() method which would return the URL that you want, see documentation here

I found that Apache's default server name has to be where django's getting it from. Now I just need to figure out how to make django use the "right" domain.
f4nt