Skip to content

Commit a9f05e0

Browse files
committed
Add cleanup management command
1 parent b25e4a8 commit a9f05e0

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

snippets/management/__init__.py

Whitespace-only changes.

snippets/management/commands/__init__.py

Whitespace-only changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from django.core.management.base import BaseCommand
2+
from django.core.management import call_command
3+
4+
5+
class Command(BaseCommand):
6+
help = 'Restores database to fresh state.'
7+
8+
def handle(self, *args, **options):
9+
call_command('flush', '--noinput')
10+
call_command('loaddata', 'snippets/fixtures/users.json')
11+
self.stdout.write(self.style.SUCCESS('Successfully restored database'))

0 commit comments

Comments
 (0)