Skip to main content

Join the Gitter chat Latest PyPI version Python versions Latest Travis CI build status Test coverage Code Climate License

django CMS page extension to handle sitemap customization

Support Python version:

  • Python 3.10, 3.11

Supported Django versions:

  • Django 4.2

Supported django CMS versions:

  • django CMS 3.11

Features

  • Support for changefreq and priority customisation per-page

  • Option to exclude a page from the Sitemap

  • Values are cached

  • django CMS toolbar integration

  • Available on Divio Cloud

Quickstart

  • Install djangocms-page-sitemap:

    pip install djangocms-page-sitemap
  • Add to INSTALLED_APPS with django.contrib.sitemaps:

    INSTALLED_APPS = [
        ...
        "django.contrib.sitemaps",
        "djangocms_page_sitemap",
    ]
  • Load it into the urlconf, eventually removing django CMS sitemap:

    ...
    urlpatterns = [
        path("admin/", admin.site.urls),
        ...
        path("", include("djangocms_page_sitemap.sitemap_urls")),
        ...
    ]
  • Load robots_index templatetag and add it to the page in the head tag of the django CMS pages (or in a shared base template):

    {% load robots_index %}
    
    ...
    <head>
    <!-- somewhere in the head tag -->
    {% page_robots %}
    </head>
     ...
  • If you need to provide a custom sitemap configuration (for example to add more sitemap classes to it, you can append the sitemap url explicitly:

    from django.contrib.sitemaps.views import sitemap
    from djangocms_page_sitemap.sitemap import ExtendedSitemap
    from myapp.sitemaps import MySiteSitemap
    
    urlpatterns = [
        ...
        path("sitemap.xml", sitemap, {
            "sitemaps": {
                "cmspages": ExtendedSitemap, "myapp": MySiteSitemap,
            }
        ),
        ...
    ]

django-app-enabler support

django-app-enabler is supported.

You can either

  • Installation & configuration: python -mapp_enabler install djangocms-page-meta

  • Autoconfiguration: python -mapp_enabler enable djangocms_page_meta

Fully using this package will require some changes that cannot be modified by django-app-enabler:

  • Remove any existing sitemap declaration from urls.py;

  • Load robots tags in the page like outlined above;

  • Run migrations: python manage.py migrate

Check documentation above for details.

Usage

After installing as above, you will be able to tune the sitemap setting for each page.

A new menu item Sitemap properties will be available in the page toolbar.

For each page you will be able to set the following flags / values:

  • Sitemap changefreq (default: the django CMS default)

  • Sitemap priority (default: 0.5)

  • Include page in sitemap (default: True)

  • Set noindex value to page robots meta tag

  • Set noarchive value to page robots meta tag

  • Provide any additional robots meta tag values

page_robots options

page_robots meta tag accepts the following parameters:

  • page: the page to render robots meta tag (default: current page). Can be any valid page lookup

  • site: the current site id (default: current site).

Settings

  • PAGE_SITEMAP_CHANGEFREQ_LIST: List of frequency changes

  • PAGE_SITEMAP_DEFAULT_CHANGEFREQ: Default changefrequency (default: django CMS value -monthly-)

  • PAGE_SITEMAP_CACHE_DURATION: Cache duration: same as django CMS menu cache)

History

1.4.0 (2025-01-15)

Features

  • Switch to Coveralls Github action (#104)

  • Drop support for Django < 4.2, python < 3.10 and django CMS < 3.11 (#121)

Bugfixes

  • Do not double-check permissions (#123)

1.3.0 (2023-09-26)

Features

  • Migrate to bump-my-version (#96)

1.2.0 (2023-05-08)

Features

  • Update GH actions / linting configuration (#79)

  • Add support for Django 4.2 / django CMS 3.11

1.1.0 (2022-08-27)

Bugfixes

  • Fix error when populating the toolbar on page types (#67)

  • Fixed serialization issue when trying to upload the addon to Divio Cloud. (#73)

  • Add support for Django 3.2 / django CMS 3.10 (#74)

1.0.0 (2020-12-21)

Features

  • Add support for django-app-enabler (#63)

  • Update tooling and drop Python 2 / Django < 2.2 compatibility (#10208)

0.8.1 (2020-05-02)

  • Enable django CMS 3.7.2 on python 3

0.8.0 (2020-01-12)

  • Relicense under BSD license

0.7.0 (2019-08-22)

  • Add compatibility with Django 2.2

  • Drop compatibility with Django < 1.11

  • Drop compatibility with django CMS < 3.6

  • Move to django-app-helper

0.6.0 (2019-07-13)

  • Drop compatibility with Django < 1.11

  • Drop compatibility with Python 3 < 3.5

0.5.4 (2019-07-13)

  • Fix error when page_robots is executed outside a request

  • Fix tox for older environments

0.5.3 (2019-03-09)

  • Add Django 2.0, 2.1 support

  • Add django CMS 3.6 support

  • Apply workaround to avoid triggering Page.site_id deprecation warning

0.5.2 (2018-04-07)

  • Make robots_extra not required

0.5.1 (2018-02-27)

  • Fix error in migration dependencies

0.5.0 (2018-02-22)

  • Add Django 1.11 support

  • Add django CMS 3.5 support

  • Package as Divio Cloud addon

  • Add support for noindex, noarchive robots meta tag

0.4.3 (2019-07-13)

  • Fix error when page_robots is executed outside a request

  • Fix tox for older environments

0.4.2 (2019-04-08)

  • Add support for noindex, noarchive robots meta tag

0.4.1 (2016-12-02)

  • Add Django 1.10 support

0.4.0 (2016-10-26)

  • Drop compatibility with django CMS 3.1 and below, Django 1.7 and below

0.3.1 (2015-10-18)

  • Improve defaults

0.3.0 (2015-10-18)

  • Add Python 3.5

  • Add option to exclude page from sitemap

0.2.0 (2015-08-15)

  • Update to support django CMS 3.1

  • Drop support for Django 1.4, 1.5

  • Add support for Django 1.8

0.1.0 (2014-08-26)

  • Initial version.

Release files for djangocms-page-sitemap 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for djangocms-page-sitemap 1.4.0
File Size Uploaded
djangocms_page_sitemap-1.4.0.tar.gz 20.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for djangocms-page-sitemap 1.4.0
File Interpreter ABI Platform
djangocms_page_sitemap-1.4.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 50.4 kB

Release files / djangocms_page_sitemap-1.4.0.tar.gz

Download URL djangocms_page_sitemap-1.4.0.tar.gz
Size 20.6 kB
Tags Source
SHA-256 checksum
How to use checksums
992219b43b40bd8fad31724f42d42de5ee80a2fe4dde1ed38bf71cb9a27bbd27
BLAKE2b-256 checksum
How to use checksums
99538bdcf28b47ae60e2b33c8a6c40905409ff3b8a7af56b44d7e8390cfd4564
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release files / djangocms_page_sitemap-1.4.0-py2.py3-none-any.whl

Download URL djangocms_page_sitemap-1.4.0-py2.py3-none-any.whl
Size 29.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
b57f7082c71fe1b77438e320fef601d2593e10237408d85047b44eb49410823f
BLAKE2b-256 checksum
How to use checksums
511a47acf1edbd50c86068053d89741b3cc135e48dcfb5928a93452e148e20d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.0

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page