def handle_noargs(self, **options): key = options.pop('key', '') idle = options.pop('idle', False) syncdb_opts = deepcopy(options) syncdb_opts['migrate_all'] = False syncdb_opts['interactive'] = False syncdb_opts['migrate'] = False syncdb_opts['database'] = 'default' migrate_opts = deepcopy(options) migrate_opts['fake'] = False migrate_opts['interactive'] = False try: cachetable = CreateCacheTable() cachetable.stdout = self.stdout cachetable.stderr = self.stderr cachetable.handle('django_dbcache', database='default') self.stdout.write('created cache table "django_dbcache"') except CommandError: self.stdout.write('not created cache table "django_dbcache". already exists.') self.stdout.write("Detecting database status\n") try: with commit_on_success(): MigrationHistory.objects.count() except DatabaseError: self.stdout.write("No database yet, but NOT running full syncdb anyway (because that causes problems with django-cms 3 cms plugin table renames).\n") if False: self.stdout.write("No database yet, running full syncdb\n") syncdb_opts['migrate_all'] = True migrate_opts['fake'] = True syncdb = SyncDB() syncdb.stdout = self.stdout syncdb.stderr = self.stderr syncdb.handle_noargs(**syncdb_opts) migrate = Migrate() migrate.stdout = self.stdout migrate.stderr = self.stderr migrate.handle(**migrate_opts) datayaml = os.path.join(settings.PROJECT_DIR, 'data.yaml') if os.path.exists(datayaml): self.stdout.write("Found data.yaml, trying to load.\n") activate(settings.CMS_LANGUAGES[0][0]) os.chdir(settings.PROJECT_DIR) loader = Loader() loader.load(datayaml) else: self.stdout.write("data.yaml not found, not loading any data.\n") if idle: self.stdout.write("running dummy http server for unknown reasons.\n") dummy_http()