Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A demonstration app that shows a problem I've encountered with django.contrib.sitemaps
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app1
app2
.gitignore
README.textile
__init__.py
manage.py
settings.py
sitemaps_bugs.db
urls.py

README.textile

Django Sitemaps Index Bug (Ticket #13908)

This Django project is meant to demonstrate a bug I’ve encountered while using the otherwise wonderful django.contrib.sitemaps.

Here’s the nut: If I try to use the “index” sitemap for more than one app, everything goes haywire and they start overwriting each other.

To see what I mean, download the app and visit the two following urls:

http://localhost:8000/app1/sitemap.xml
http://localhost:8000/app2/sitemap.xml

What you’ll see is that both of the pagination url sets point to the app2 subdirectory.

This seems to be caused by the fact that I’m not calling a single sitemap index from the root urls file, but instead calling two, one from each app’s urlset.

Maybe this is the wrong way to use sitemaps, and I can be ignored, but I think the problem happens in line 17 of django.contrib.sitemaps.views where the url is reversed.

Finally, I had this problem with Django 1.1, though I imagine it still would occur in 1.2 and later.

Something went wrong with that request. Please try again.