pygal/management/commands/rebuild_index.py

10 lines
321 B
Python
Raw Normal View History

2020-01-26 23:38:32 +01:00
from django.core.management.base import BaseCommand
from pygal.search import create_index, rebuild_index
class Command(BaseCommand):
def handle(self, *args, **options):
ix = create_index()
n = rebuild_index(ix)
self.stdout.write(self.style.SUCCESS('Search index for %d items created.') % n)