| author | ymh <ymh.work@gmail.com> |
| Wed, 20 Jan 2010 00:34:04 +0100 | |
| changeset 0 | 0d40e90630ef |
| permissions | -rw-r--r-- |
| 0 | 1 |
from django.core.management.base import BaseCommand |
2 |
from django.contrib.sitemaps import ping_google |
|
3 |
||
4 |
||
5 |
class Command(BaseCommand): |
|
6 |
help = "Ping google with an updated sitemap, pass optional url of sitemap" |
|
7 |
||
8 |
def execute(self, *args, **options): |
|
9 |
if len(args) == 1: |
|
10 |
sitemap_url = args[0] |
|
11 |
else: |
|
12 |
sitemap_url = None |
|
13 |
ping_google(sitemap_url=sitemap_url) |
|
14 |