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 +++++++++++++++- docs/releases/2.2.txt | 6 ++++++ 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'docs') 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``. diff --git a/docs/releases/2.2.txt b/docs/releases/2.2.txt index 4a529f30da..87a7ef4931 100644 --- a/docs/releases/2.2.txt +++ b/docs/releases/2.2.txt @@ -479,6 +479,12 @@ Miscellaneous passed as a value to encode because ``None`` can't be encoded in GET and POST data. Either pass an empty string or omit the value. +* The :djadmin:`ping_google` management command now defaults to ``https`` + instead of ``http`` for the sitemap's URL. If your site uses http, use the + new :option:`ping_google --sitemap-uses-http` option. If you use the + :func:`~django.contrib.sitemaps.ping_google` function, set the new + ``sitemap_uses_https`` argument to ``False``. + .. _deprecated-features-2.2: Features deprecated in 2.2 -- cgit v1.3