← Back
Editing: __init__.cpython-311.pyc
� �|�e � �� � d dl mZ d dlmZ d dlmZ d dlmZ d dl m Z d dlmZ d dl mZmZ d dlmZ d Z G d � de� � Zded fd�Zdd�Z G d� d� � Z G d� de� � ZdS )� )� urlencode)�urlopen)�apps)�settings)� paginator)�ImproperlyConfigured)�NoReverseMatch�reverse)�translationz,https://www.google.com/webmasters/tools/pingc � � e Zd ZdS )�SitemapNotFoundN)�__name__� __module__�__qualname__� � �B/usr/lib/python3/dist-packages/django/contrib/sitemaps/__init__.pyr r s � � � � � ��Dr r NTc �p � t | |� � }t d|i� � }t |�d|��� � dS )a+ Alert Google that the sitemap for the current site has been updated. If sitemap_url is provided, it should be an absolute path to the sitemap for this site -- e.g., '/sitemap.xml'. If sitemap_url is not provided, this function will attempt to deduce it by using urls.reverse(). �sitemap�?N)�_get_sitemap_full_urlr r )�sitemap_url�ping_url�sitemap_uses_https�sitemap_full_url�paramss r �ping_googler sG � � -�[�:L�M�M�� � �#3�4� 5� 5�F��x�x�x���(�)�)�)�)�)r c �t � t j d� � st d� � �| �B t d� � } n1# t $ r$ t d� � } n# t $ r Y nw xY wY nw xY w| �t d� � �t j d� � }|j � � � }|rdnd}|�d |j �| ��S ) N�django.contrib.siteszAping_google requires django.contrib.sites, which isn't installed.z#django.contrib.sitemaps.views.indexz%django.contrib.sitemaps.views.sitemapzPYou didn't provide a sitemap_url, and the sitemap URL couldn't be auto-detected.� sites.Site�https�http�://) �django_apps�is_installedr r r r � get_model�objects�get_current�domain)r r �Site�current_site�schemes r r r s� � ��#�$:�;�;� h�"�#f�g�g�g��� �!�"G�H�H�K�K��� � � � �%�&M�N�N����!� � � ��� ������ ���� ���p�q�q�q�� ��.�.�D��<�+�+�-�-�L�*� 6�W�W��F� �&�&�,�"5�"5�{�{�C�Cs3 �7 � A%�A�A%� A�A%�A�A%�$A%c � � e Zd ZdZdZdZdZdZdZdd�Z d� Z d� Zdd�Ze d� � � Zd � Zd � Zdd�Zdd�Zdd�Zd� ZdS )�SitemapiP� NFc � � t | |� � }n# t $ r |cY S w xY wt |� � r| j r|\ }} ||� � S |S �N)�getattr�AttributeError�callable�i18n)�self�name�item�default�attr� lang_codes r �_getzSitemap._getK sr � � ��4��&�&�D�D��� � � ��N�N�N� �����D�>�>� ��y� '� #'���i��4��:�:���s � �"�"c �J � | j �| j S d� t j D � � S )Nc � � g | ]\ }}|��S r r )�.0r: �_s r � <listcomp>z&Sitemap._languages.<locals>.<listcomp>[ s � �A�A�A�l�i�� �A�A�Ar )� languagesr � LANGUAGES�r5 s r � _languageszSitemap._languagesX s) � ��>�%��>�!�A�A�h�.@�A�A�A�Ar c �~ � � � j r"� fd�� � � � D � � }|S � � � � S )Nc �F �� g | ]}�� � � D ]}||f���S r )�items)r>