File: //usr/lib/python3/dist-packages/django/contrib/sitemaps/__pycache__/__init__.cpython-310.pyc
o
3�a � @ s� d dl mZ d dlmZ d dlmZ d dlmZ d dl m
Z
d dlmZ d dl
mZmZ d dlmZ d ZG d
d� de�Zded
fdd�Zddd�ZG dd� d�ZG dd� de�ZdS )� )� urlencode)�urlopen)�apps)�settings)� paginator)�ImproperlyConfigured)�NoReverseMatch�reverse)�translationz,https://www.google.com/webmasters/tools/pingc @ s e Zd ZdS )�SitemapNotFoundN)�__name__�
__module__�__qualname__� r r �B/usr/lib/python3/dist-packages/django/contrib/sitemaps/__init__.pyr s r NTc C s* t | |�}td|i�}td||f � 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().
�sitemapz%s?%sN)�_get_sitemap_full_urlr r )�sitemap_url�ping_url�sitemap_uses_https�sitemap_full_url�paramsr r r �ping_google s
r c C s� t �d�s td��| d u r-ztd�} W n ty, ztd�} W n ty) Y nw Y nw | d u r5td��t �d�}|j�� }|rCdnd}d ||j | f 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�httpz %s://%s%s)
�django_apps�is_installedr r r r � get_model�objects�get_current�domain)r r �Site�current_site�schemer r r r s&