mod: современный способ создания sitemap.xml

This commit is contained in:
2026-02-18 16:00:52 +03:00
parent 33fa2d04a9
commit 65feb36f77
7 changed files with 68 additions and 29 deletions

View File

@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
__author__ = "Sergei Erjemin"
__copyright__ = "Copyright 2020, Sergei Erjemin"
__copyright__ = "Copyright 2020-2026, Sergei Erjemin"
__credits__ = ["Sergei Erjemin", ]
__license__ = "GPL"
__version__ = "0.0.1"
__version__ = "0.3.9"
__maintainer__ = "Sergei Erjemin"
__email__ = "erjemin@gmail.com"
__status__ = "in progress"
@@ -92,13 +92,3 @@ def index(request):
response = render(request, template, to_template)
return response
def sitemap(request):
template = "sitemap.xml" # шаблон
to_template = []
dq = TbDictumAndQuotes.objects.order_by('id').all()
for i in dq:
to_template.append({"ID": i.id,
"SLUG": pytils.translit.slugify(i.szContent.lower()[:120])})
response = render(request, template, {"DATA": to_template})
return response