2008-07-01 20:25:59 +08:00
|
|
|
from django.contrib.sitemaps import ping_google
|
2015-01-28 20:35:27 +08:00
|
|
|
from django.core.management.base import BaseCommand
|
2008-07-01 20:25:59 +08:00
|
|
|
|
|
|
|
|
|
|
|
class Command(BaseCommand):
|
2010-12-13 06:56:52 +08:00
|
|
|
help = "Ping Google with an updated sitemap, pass optional url of sitemap"
|
2008-07-01 20:25:59 +08:00
|
|
|
|
2014-09-01 18:38:08 +08:00
|
|
|
def add_arguments(self, parser):
|
|
|
|
parser.add_argument('sitemap_url', nargs='?', default=None)
|
|
|
|
|
2014-10-19 23:23:50 +08:00
|
|
|
def handle(self, *args, **options):
|
2014-09-01 18:38:08 +08:00
|
|
|
ping_google(sitemap_url=options['sitemap_url'])
|