summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorAndrew Northall <andrew@northall.me.uk>2023-07-02 21:48:56 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-07-10 05:59:35 +0200
commit6d427288e410e9cad39b1aa1b4d4893fbd391282 (patch)
tree6248db20899d162ab4df51d896986ec3f47fad12 /docs/ref
parent2584783f46922bcb456ceb9700a3726314df65d3 (diff)
Fixed #34688 -- Removed contrib.sitemaps.ping_google() and ping_google management command.
Thanks Joachim Jablon for the report. Google has deprecated the sitemap ping endpoint, and will be removing it in 6 months ~January 2024.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/sitemaps.txt75
-rw-r--r--docs/ref/django-admin.txt12
2 files changed, 0 insertions, 87 deletions
diff --git a/docs/ref/contrib/sitemaps.txt b/docs/ref/contrib/sitemaps.txt
index 57bcc81a01..020eaf03ff 100644
--- a/docs/ref/contrib/sitemaps.txt
+++ b/docs/ref/contrib/sitemaps.txt
@@ -588,78 +588,3 @@ generate a Google News compatible sitemap:
</urlset>
.. _`Google news sitemaps`: https://support.google.com/news/publisher-center/answer/9606710
-
-Pinging Google
-==============
-
-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, sitemap_uses_https=True)
-
- ``ping_google`` takes these optional arguments:
-
- * ``sitemap_url`` - The absolute path to your site's sitemap (e.g.,
- :file:`'/sitemap.xml'`).
-
- If this argument isn't provided, ``ping_google`` will perform a reverse
- lookup in your URLconf, for URLs named
- ``'django.contrib.sitemaps.views.index'`` and then
- ``'django.contrib.sitemaps.views.sitemap'`` (without further arguments) to
- automatically determine the sitemap URL.
-
- * ``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.
-
-.. admonition:: Register with Google first!
-
- The :func:`ping_google` command only works if you have registered your
- site with `Google Search Console`_.
-
-.. _`Google Search Console`: https://search.google.com/search-console/welcome
-
-One useful way to call :func:`ping_google` is from a model's ``save()``
-method::
-
- from django.contrib.sitemaps import ping_google
-
-
- class Entry(models.Model):
- # ...
- def save(self, force_insert=False, force_update=False):
- super().save(force_insert, force_update)
- try:
- ping_google()
- except Exception:
- # Bare 'except' because we could get a variety
- # of HTTP-related exceptions.
- pass
-
-A more efficient solution, however, would be to call :func:`ping_google` from a
-cron script, or some other scheduled task. The function makes an HTTP request
-to Google's servers, so you may not want to introduce that network overhead
-each time you call ``save()``.
-
-Pinging Google via ``manage.py``
---------------------------------
-
-.. django-admin:: ping_google [sitemap_url]
-
-Once the sitemaps application is added to your project, you may also
-ping Google using the ``ping_google`` management command:
-
-.. code-block:: shell
-
- python manage.py ping_google [/sitemap.xml]
-
-.. django-admin-option:: --sitemap-uses-http
-
-Use this option if your sitemap uses ``http`` rather than ``https``.
diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt
index 110b1e802a..a46910f9f3 100644
--- a/docs/ref/django-admin.txt
+++ b/docs/ref/django-admin.txt
@@ -1759,18 +1759,6 @@ documentation.
Can be run as a cron job or directly to clean out expired sessions.
-``django.contrib.sitemaps``
----------------------------
-
-``ping_google``
-~~~~~~~~~~~~~~~
-
-This command is only available if the :doc:`Sitemaps framework
-</ref/contrib/sitemaps>` (``django.contrib.sitemaps``) is installed.
-
-Please refer to its :djadmin:`description <ping_google>` in the Sitemaps
-documentation.
-
``django.contrib.staticfiles``
------------------------------