1 2 3 4 5 6 7 8 9 10 11 12
from django.contrib.sitemaps import Sitemap from ..product.models import Product class ProductSitemap(Sitemap): def items(self): return Product.objects.only('id', 'name').order_by('-id') sitemaps = {'products': ProductSitemap}