mirror of https://github.com/snachodog/mybuddy.git
Clear cache during `reset` operation
This commit is contained in:
parent
fd6bcfe9a5
commit
6662d1036d
|
@ -3,6 +3,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.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
|
||||||
|
|
||||||
|
@ -51,6 +52,11 @@ class Command(BaseCommand):
|
||||||
options['migration_name'] = None
|
options['migration_name'] = None
|
||||||
migrate.handle(*args, **options)
|
migrate.handle(*args, **options)
|
||||||
|
|
||||||
|
# Clear cache.
|
||||||
|
cache.clear()
|
||||||
|
if verbosity > 0:
|
||||||
|
self.stdout.write(self.style.SUCCESS('Cache cleared.'))
|
||||||
|
|
||||||
# Populate database with fake data.
|
# Populate database with fake data.
|
||||||
fake = Fake()
|
fake = Fake()
|
||||||
fake.handle(*args, **options)
|
fake.handle(*args, **options)
|
||||||
|
|
Loading…
Reference in New Issue