Add cache table creation to reset command

This commit is contained in:
Christopher C. Wells 2022-10-29 19:39:18 -07:00
parent a6c1e2cb38
commit 6392ffb37b
1 changed files with 6 additions and 0 deletions

View File

@ -4,6 +4,7 @@ from os import path
from django.apps import apps from django.apps import apps
from django.contrib.auth import get_user_model from django.contrib.auth import get_user_model
from django.core.cache import cache from django.core.cache import cache
from django.core.management import call_command
from django.core.management.base import BaseCommand, CommandError from django.core.management.base import BaseCommand, CommandError
from django.core.management.commands.flush import Command as Flush from django.core.management.commands.flush import Command as Flush
@ -56,6 +57,11 @@ class Command(BaseCommand):
options["migration_name"] = None options["migration_name"] = None
migrate.handle(*args, **options) migrate.handle(*args, **options)
# Create cache table.
call_command("createcachetable")
if verbosity > 0:
self.stdout.write(self.style.SUCCESS("Cache table created."))
# Clear cache. # Clear cache.
cache.clear() cache.clear()
if verbosity > 0: if verbosity > 0: