def ping_google(sitemap_url=None, ping_url=PING_URL):
    if sitemap_url is None:
        try:
            # First, try to get the "index" sitemap URL.
            sitemap_url = urlresolvers.reverse('django.contrib.sitemaps.views.index')
        except urlresolvers.NoReverseMatch:
            try:
                # Next, try for the "global" sitemap URL.
                sitemap_url = urlresolvers.reverse('django.contrib.sitemaps.views.sitemap')
            except urlresolvers.NoReverseMatch:
                pass

    if sitemap_url is None:
        raise SitemapNotFound("You didn't provide a sitemap_url, and the sitemap URL couldn't be auto-detected.")

    from django.contrib.sites.models import Site
    current_site = Site.objects.get_current()
    url = "http://%s%s" % (current_site.domain, sitemap_url)
    params = urlencode({'sitemap':url})
    urlopen("%s?%s" % (ping_url, params))
Alerts Google that the sitemap for the current site has been updated.
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/contrib/sitemaps/__init__.py/ping_google