@@ -0,0 +1,2220 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.apps import apps%0Afrom django.contrib.auth import get_user_model%0Afrom django.core.management.base import BaseCommand, CommandError%0Afrom django.core.management.commands.flush import Command as Flush%0Afrom django.core.management.commands.migrate import Command as Migrate%0A%0Afrom .fake import Command as Fake%0A%0A%0Aclass Command(BaseCommand):%0A    help = 'Reapplies core migrations and generates fake data.'%0A%0A    def __init__(self, *args, **kwargs):%0A        super(Command, self).__init__(*args, **kwargs)%0A        self.UserModel = get_user_model()%0A        self.username_field = self.UserModel._meta.get_field(%0A            self.UserModel.USERNAME_FIELD)%0A%0A    def add_arguments(self, parser):%0A        Migrate().add_arguments(parser)%0A        Fake().add_arguments(parser)%0A%0A    def handle(self, *args, **options):%0A        verbosity = options%5B'verbosity'%5D%0A        database = options%5B'database'%5D%0A%0A        flush = Flush()%0A        flush.handle(**options)%0A        if verbosity %3E 0:%0A            self.stdout.write(self.style.SUCCESS('Database flushed.'))%0A%0A        for config in apps.app_configs.values():%0A            if config.path.split('/')%5B-2%5D == 'babyblotter':%0A                migrate = Migrate()%0A                options%5B'app_label'%5D = config.name%0A                options%5B'migration_name'%5D = 'zero'%0A%0A                try:%0A                    migrate.handle(*args, **options)%0A                except CommandError:%0A                    # Ignore apps without migrations.%0A                    pass%0A%0A        migrate = Migrate()%0A        options%5B'app_label'%5D = None%0A        options%5B'migration_name'%5D = None%0A        migrate.handle(*args, **options)%0A%0A        self.UserModel._default_manager.db_manager(database).create_superuser(%0A            **%7B%0A                self.UserModel.USERNAME_FIELD: 'admin',%0A                'email': 'admin@admin.admin',%0A                'password': 'admin'%0A            %7D%0A        )%0A        if options%5B'verbosity'%5D %3E 0:%0A            self.stdout.write('Superuser created successfully.')%0A%0A        fake = Fake()%0A        fake.handle(*args, **options)%0A%0A        if verbosity %3E 0:%0A            self.stdout.write(self.style.SUCCESS('Database reset complete.'))%0A

Add "reset" management command for resetting the database with fake data.