Skip to main content

A small Django app to manage sitemap.xml overrides on a per-object basis

Project description

A small Django app to manage sitemap.xml overrides on a per-object basis.

Brief installation notes are given below, but see our online documentation for more details.

Documentation Status


Django 1.4.2 or greater, Python 2.7 or greater.


Use your favorite Python installer to install it from PyPI:

$ pip install django-sitemapper

If you are using pip version 1.4 or later you’ll need to explicitly allow pre-release installation:

$ pip install --pre django-sitemapper

Or get the source from the application site:

$ hg clone
$ cd django-sitemapper
$ python install


Add "sitemapper" to your INSTALLED_APPS setting like this:


For Django 1.7 users, run python migrate to create the models. Otherwise simply run python syncdb.

Setting up a sitemap

Create a file within your app directory and add the following (replacing MyModel with whatever you called yours):

from sitemapper.sitemaps import Sitemap
from .models import MyModel

class MyModelSitemap(Sitemap):

    # Set some defaults for your model's sitemap...
    default_changefreq = 'weekly'
    default_priority = 0.5

    # ... and the queryset you want to use...
    queryset = MyModel.objects.all()

    # ... and some means to access the last-modified timestamp.
    def lastmod(self, obj):
        return obj.lastmodified

From this point onwards you can use MyModelSitemap as you would any other sitemaps instance. See Django’s sitemaps documentation for how to wire this up with your urlconf.


The project is licensed under the MIT license.

Release Notes


  • Deprecated: sitemapper.mixins.Sitemap has moved; use sitemapper.sitemaps.Sitemap instead.
  • Fixed: Incorrect tox testenv.
  • Changed: Refactored ContentType lookup into custom manager method. Sitemap now uses SitemapEntry.get_for_model() method.

This is, hopefully, the final beta release. There is still work to be done with tests and documentation, but I don’t see the API changing between now and the final release. I expect there will be a release-candidate following in short order followed by 1.0 final within a week.

Please let me know if you have any questions, suggestions or problems to report via the issue tracker.


  • Schema: SitemapEntry.priority and SitemapEntry.changefreq are now nullable.
  • Fixed: admin select widget issue for SitemapEntry.priority values of decimal integers (i.e. ‘0.0’ and ‘1.0’)
  • Changed: Refactored Sitemap.priority() and Sitemap.changefreq() methods.
  • New: Added support for South migrations.
  • New: Support Django 1.4.2 and greater.


  • Backwards Incompatible: Removed sitemapper.SitemappedModel mixin.
  • Changed: sitemapper.mixins.Sitemap now handles all lookups internally, and more efficiently.
  • New: Support Django 1.5 and greater.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-sitemapper, version 1.0.0-beta.3
Filename, size File type Python version Upload date Hashes
Filename, size django-sitemapper-1.0.0-beta.3.tar.gz (18.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page