No project description provided
Project description
sitemap.xml generation using lxml with support for alternates.
Usage
from app.pages.sitemaps import PagesSitemap def sitemap(request): sitemap = Sitemap(build_absolute_uri=request.build_absolute_uri) sitemap.add_django_sitemap(request, PagesSitemap) for p in Page.objects.active(): url = p.get_absolute_url() sitemap.add( url, changefreq='weekly', priority=0.5, lastmod=p.modification_date, alternates={ code: urljoin(domain, url) for code, domain in PAGE_DOMAINS[p.language].items() }, ) return sitemap.response(pretty_print=settings.DEBUG)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-sitemaps-1.0.tar.gz
(3.7 kB
view details)
Built Distribution
File details
Details for the file django-sitemaps-1.0.tar.gz
.
File metadata
- Download URL: django-sitemaps-1.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e33cd860176835a4bd9ee00bae3c31258da6ddb1fd277a752745c19e36c4c7f1 |
|
MD5 | 3a02d5d2f904343597a2052f23cacb7e |
|
BLAKE2b-256 | e6d02cd671593be206cfe95f52f402156cb7433597a84b4883a0495c98c1b972 |
File details
Details for the file django_sitemaps-1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: django_sitemaps-1.0-py2.py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 630f589bf319f34b699d0bb3690256750dcaa30ee5adfd9a1a9b4bbdbc991df7 |
|
MD5 | a54624057cb3d162c05e622ca86c1268 |
|
BLAKE2b-256 | 69e895d10b52adba03fc7d280ec6ba75382a72eab938b915688e87b1b6542066 |