Reputation: 8357
In Django 1.4.12, I have a Sitemap class:
class MySitemap(Sitemap):
def items(self):
return ['/my/url1/',
'/my/url2/',]
def location(self, obj):
return str(obj)
and in urls.py
sitemaps = {
'global': MySitemap,
}
...
urlpatterns = patterns('',
...
url(r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}),
However, my generate sitemap.xml has http://http://
in front of it, such as:
...
<url><loc>http://http://mywebsite.com/my/url1</loc></url>
...
What is causing this problem?
Upvotes: 2
Views: 695
Reputation: 53719
You have probably included http://
in your Site
object's domain name from the sites framework (django.contrib.sites
). Remove it.
This field should only include the actual domain name, not the protocol, as the protocol itself can change (e.g. to https://
).
Upvotes: 6