|
|
|
|
@ -3,9 +3,9 @@ from django.core.management.base import BaseCommand
|
|
|
|
|
from djangoblog.utils import cache
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Command(BaseCommand):
|
|
|
|
|
help = 'clear the whole cache'
|
|
|
|
|
class Command(BaseCommand): #ZNY 定义清除缓存命令类,继承BaseCommand
|
|
|
|
|
help = 'clear the whole cache' #ZNY 命令帮助信息:清除整个缓存
|
|
|
|
|
|
|
|
|
|
def handle(self, *args, **options):
|
|
|
|
|
cache.clear()
|
|
|
|
|
self.stdout.write(self.style.SUCCESS('Cleared cache\n'))
|
|
|
|
|
def handle(self, *args, **options): #ZNY 命令处理主方法
|
|
|
|
|
cache.clear() #ZNY 调用Django缓存接口清除所有缓存
|
|
|
|
|
self.stdout.write(self.style.SUCCESS('Cleared cache\n')) #ZNY 输出成功信息到标准输出
|
|
|
|
|
|