def __init__(self, settings):
        self.conf = settings

        handlers = self.conf.HANDLERS
        if handlers is not None:
            try:
                handlers = load_class(handlers + ".patterns")
            except __HOLE__:
                raise RuntimeError("Cannot import  handlers path: {0}".format(handlers))
            handlers = self._setup_handlers(handlers) or None

        tornado_settings = copy.deepcopy(self.conf.TORNADO_SETTINGS)
        tornado_settings.update({"cookie_secret": self.conf.SECRET_KEY})

        super(Application, self).__init__(handlers=handlers, default_host=self.conf.TORNADO_DEFAULT_HOST,
            transforms=self.conf.TORNADO_TRANSFORMS, wsgi=self.conf.TORNADO_WSGI_MODE, **tornado_settings)

        self._setup_database_engine()
        self._setup_session_engine()
        self._setup_authentication_engine()
        self._setup_template_loaders()
        self._setup_template_engine()
        self._setup_i18n()
        self._setup_installed_modules()

        set_app(self)
dataset/ETHPy150Open niwinz/tornado-webtools/webtools/application.py/Application.__init__