Django Library PyGal
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

rebuild_index.py 321B

123456789
  1. from django.core.management.base import BaseCommand
  2. from pygal.search import create_index, rebuild_index
  3. class Command(BaseCommand):
  4. def handle(self, *args, **options):
  5. ix = create_index()
  6. n = rebuild_index(ix)
  7. self.stdout.write(self.style.SUCCESS('Search index for %d items created.') % n)