Add clear cache management command
This commit is contained in:
parent
7a419f3b14
commit
59a4ffc4ff
1 changed files with 10 additions and 0 deletions
10
gallery/management/commands/clear_cache.py
Normal file
10
gallery/management/commands/clear_cache.py
Normal file
|
@ -0,0 +1,10 @@
|
|||
from django.core.cache import cache
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = "Clears the entire Django cache."
|
||||
|
||||
def handle(self, *args, **options):
|
||||
cache.clear()
|
||||
self.stdout.write(self.style.SUCCESS("Cache cleared successfully."))
|
Loading…
Add table
Reference in a new issue