Exemplo n.º 1
0
 def execute(self, *args, **options):
     settings = connections['default'].settings_dict.copy()
     settings['ENGINE'] = 'sqlite3'
     if 'application_name' in settings['OPTIONS']:
         del settings['OPTIONS']['application_name']
     connections['default'] = DatabaseWrapper(settings)
     return MakeMigrations().execute(*args, **options)
Exemplo n.º 2
0
    def write_migration_files(self, changes):
        other = MakeMigrations()
        other.verbosity = self.verbosity
        other.interactive = self.interactive
        other.dry_run = self.dry_run
        other.stderr = self.stderr
        other.stdout = self.stdout

        other.write_migration_files(changes)
Exemplo n.º 3
0
    def handle(self, *args, **options):

        if "RUN_MAIN" not in os.environ:
            # RUN_MAIN added by auto reloader, see: django/utils/autoreload.py
            self.verbose_call(
                command=MakeMigrations())  # helpfull for developming
            self.verbose_call(command=Migrate(), run_syncdb=True)
            self.verbose_call(command=CollectStatic(),
                              interactive=False,
                              link=True,
                              verbosity=1)

            User = get_user_model()
            qs = User.objects.filter(is_active=True, is_superuser=True)
            if qs.count() == 0:
                self.verbose_call(command=CreateSuperUser())

            self.verbose_call(command=Check())

        self.verbose_call(command=RunServer(),
                          use_threading=False,
                          use_reloader=True,
                          verbosity=2)
 def execute(self, *args, **options):
     settings = connections['default'].settings_dict.copy()
     settings['ENGINE'] = 'sqlite3'
     connections['default'] = DatabaseWrapper(settings)
     return MakeMigrations().execute(*args, **options)