Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #7185 -- Added a "ping_google" management command to
django.contrib.sitemaps. Thanks, Pete Shinners. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7813 bcc190cf-cafb-0310-a4f2-bffc1f526a37
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
django/contrib/sitemaps/management/commands/ping_google.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,14 @@ | |||
from django.core.management.base import BaseCommand | |||
from django.contrib.sitemaps import ping_google | |||
|
|||
|
|||
class Command(BaseCommand): | |||
help = "Ping google with an updated sitemap, pass optional url of sitemap" | |||
|
|||
def execute(self, *args, **options): | |||
if len(args) == 1: | |||
sitemap_url = args[0] | |||
else: | |||
sitemap_url = None | |||
ping_google(sitemap_url=sitemap_url) | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters