def add(self, app): ApplicationFactory.add(self, app) try: self.apps_by_domain[app.domain] = app except AttributeError: pass