def cleanup(self):
        super(DjangoRole, self).cleanup()

        if SITES_KEY in self.context:
            for website in self.context[SITES_KEY]:
                updated = self._update_init_script(website)
                settings_updated = self._update_settings(website)
                if website.use_supervisor:
                    self._update_supervisor_program(website)
                if updated or settings_updated:
                    self._ensure_restart(website)

        if MUST_RESTART_KEY in self.context and self.context[MUST_RESTART_KEY]:
            if self.restart_supervisor_on_changes:
                with self.using(SupervisorRole) as role:
                    role.ensure_restart()
            for site in self.context[MUST_RESTART_KEY]:
                self._restart(site)
Updates the website and/or init files and restarts websites if needed.
dataset/ETHPy150Open python-provy/provy/provy/more/debian/web/django.py/DjangoRole.cleanup