From 76d31be2d04dd6e6bcb5cb39a29ea9ed3938d0f9 Mon Sep 17 00:00:00 2001 From: Sanyam Khurana Date: Thu, 10 Jan 2019 15:30:00 +0530 Subject: Refs #23829 -- Made ping_google command/function use https for the sitemap URL. --- docs/ref/contrib/sitemaps.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'docs/ref') diff --git a/docs/ref/contrib/sitemaps.txt b/docs/ref/contrib/sitemaps.txt index 3ba601bc67..166013659d 100644 --- a/docs/ref/contrib/sitemaps.txt +++ b/docs/ref/contrib/sitemaps.txt @@ -481,7 +481,7 @@ You may want to "ping" Google when your sitemap changes, to let it know to reindex your site. The sitemaps framework provides a function to do just that: :func:`django.contrib.sitemaps.ping_google()`. -.. function:: ping_google(sitemap_url=None, ping_url=PING_URL) +.. function:: ping_google(sitemap_url=None, ping_url=PING_URL, sitemap_uses_https=True) ``ping_google`` takes these optional arguments: @@ -493,10 +493,18 @@ that: :func:`django.contrib.sitemaps.ping_google()`. * ``ping_url`` - Defaults to Google's Ping Tool: https://www.google.com/webmasters/tools/ping. + * ``sitemap_uses_https`` - Set to ``False`` if your site uses ``http`` + rather than ``https``. + :func:`ping_google` raises the exception ``django.contrib.sitemaps.SitemapNotFound`` if it cannot determine your sitemap URL. + .. versionadded:: 2.2 + + The ``sitemap_uses_https`` argument was added. Older versions of + Django always use ``http`` for a sitemap's URL. + .. admonition:: Register with Google first! The :func:`ping_google` command only works if you have registered your @@ -534,3 +542,9 @@ Once the sitemaps application is added to your project, you may also ping Google using the ``ping_google`` management command:: python manage.py ping_google [/sitemap.xml] + +.. django-admin-option:: --sitemap-uses-http + +.. versionadded:: 2.2 + +Use this option if your sitemap uses ``http`` rather than ``https``. -- cgit v1.3