def activate(self, test=False):
        # at this point the apps are NOT ready,
        # but we can make database connections

        if self.is_active and not test:  # pragma: no cover
            return True

        logger.debug('Site activation started')

        # ~~~~ reports ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        for dashboard in self.dashboards:
            for report in dashboard.reports:
                ct = ContentType.objects.get_for_model(report.model)
                report.object, created = Report.objects.get_or_create(
                    key=report.key,
                    contenttype=ct
                )
                if created:
                    logger.debug('Reportobject for report %s created' % report.key)

        # ~~~~ settings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        register_settings = list(self.settings.keys())
        for setting in Configuration.objects.all():
            key = '.'.join((setting.app_label, setting.field_name))

            if key in self.settings:
                if not setting.active:
                    setting.active = True
                    setting.save()
                register_settings.remove(key)

            elif setting.active:
                setting.active = False
                setting.save()

        if register_settings:
            logger.debug('Need to register new settings')
            for setting in register_settings:
                app, name = setting.split('.', 1)
                Configuration.objects.create(app_label=app, field_name=name)
                logger.debug('Registered setting %s' % setting)

        # ~~~~ END ~ activate ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        self.is_active = True
        logger.debug('Site is now active')
        return True

    # --- modules -------------------------------------------------------------
dataset/ETHPy150Open django-bmf/django-bmf/djangobmf/core/site.py/Site.activate/original