2008-07-01 20:25:59 +08:00
|
|
|
from django.core.management.base import BaseCommand
|
|
|
|
from django.contrib.sitemaps import ping_google
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
def execute(self, *args, **options):
|
|
|
|
if len(args) == 1:
|
|
|
|
sitemap_url = args[0]
|
|
|
|
else:
|
|
|
|
sitemap_url = None
|
|
|
|
ping_google(sitemap_url=sitemap_url)
|