Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

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.

Requirements

Django 1.5 or greater, Python 2.7 or greater.

Installation

Use your favorite Python installer to install it from PyPI:

$ pip install django-sitemapper

Or get the source from the application site:

$ hg clone https://bitbucket.org/mhurt/django-sitemapper
$ cd django-sitemapper
$ python setup.py install

Configuration

Add "sitemapper" to your INSTALLED_APPS setting like this:

INSTALLED_APPS = {
  ...
  'sitemapper'
}

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

Setting up a sitemap

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

# sitemaps.py
from sitemapper.mixins 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.

License

The project is licensed under the MIT license.

Release History

Release History

This version
History Node

1.0.0-beta.1

History Node

1.0.0-alpha.3

History Node

1.0.0-alpha.2

History Node

1.0.0-alpha.1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-sitemapper-1.0.0-beta.1.tar.gz (15.0 kB) Copy SHA256 Checksum SHA256 Source Oct 6, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting