o 3a @sddlZddlmZddlmZddlmZddlmZm Z ddl m Z ddl m Z ddlmZdd lmZd d Ze dddZe  dddZdS)N)timegmwraps)get_current_site) EmptyPagePageNotAnInteger)Http404)TemplateResponse)reverse) http_datecstfdd}|S)Ncs$|g|Ri|}d|jd<|S)Nznoindex, noodp, noarchivez X-Robots-Tag)headers)requestargskwargsresponsefunc?/usr/lib/python3/dist-packages/django/contrib/sitemaps/views.pyinners zx_robots_tag..innerr)rrrrr x_robots_tag srsitemap_index.xmlapplication/xml%django.contrib.sitemaps.views.sitemapcCs|j}t|}g}|D]?\}} t| r| } | jdur|n| j} t|d|id} d| |j| f} || td| j j dD] } |d| | fq@q t ||d|i|dS) Nsection)rz %s://%s%sz%s?p=%ssitemaps content_type) schemeritemscallableprotocolr domainappendrange paginator num_pagesr )r r template_namersitemap_url_name req_protocolreq_sitesitesrsiter# sitemap_url absolute_urlpagerrrindexs   r2 sitemap.xmlc CsB|j}t|}|dur||vrtd|||g}n|}|jdd}d} d} g} |D]W} zcalendarr functoolsrdjango.contrib.sites.shortcutsrdjango.core.paginatorrr django.httprdjango.template.responser django.urlsr django.utils.httpr rr2rGrrrrs$