Exemplo n.º 1
0
    def __init__(self, config_file):
        conf = config.parse_config(config_file)
        handlers = [
            (r"/",          views.IndexHandler),
            (r"/lang/(.+)", views.LangHandler),
            (r"/dashboard", views.DashboardHandler),
            (r"/account",   views.AccountHandler),
            (r"/signup",    views.SignUpHandler),
            (r"/signin",    views.SignInHandler),
            (r"/signout",   views.SignOutHandler),
            (r"/passwd",    views.PasswdHandler),
            (r"/legal",     cyclone.web.RedirectHandler,
                                {"url": "/static/legal.txt"}),
        ]

        # Initialize locales
        if "locale_path" in conf:
            cyclone.locale.load_gettext_translations(conf["locale_path"],
                                                     "$modname")

        # Set up database connections
        DatabaseMixin.setup(conf)

        conf["login_url"] = "/signin"
        conf["autoescape"] = None
        cyclone.web.Application.__init__(self, handlers, **conf)
Exemplo n.º 2
0
    def __init__(self, config_file):
        handlers = [
            (r"/",              views.IndexHandler),
            (r"/lang/(.+)",     views.LangHandler),
        ]

        settings = config.parse_config(config_file)

        # Initialize locales
        locales = settings.get("locale_path")
        if locales:
            cyclone.locale.load_gettext_translations(locales, "$modname")

        #settings["login_url"] = "/auth/login"
        #settings["autoescape"] = None
        cyclone.web.Application.__init__(self, handlers, **settings)
Exemplo n.º 3
0
    def __init__(self, config_file):
        handlers = [
            (r"/",              views.IndexHandler),
            (r"/lang/(.+)",     views.LangHandler),
            (r"/sample/mysql",  views.SampleMySQLHandler),
            (r"/sample/redis",  views.SampleRedisHandler),
            (r"/sample/sqlite", views.SampleSQLiteHandler),
        ]

        settings = config.parse_config(config_file)

        # Initialize locales
        locales = settings.get("locale_path")
        if locales:
            cyclone.locale.load_gettext_translations(locales, "$modname")

        # Set up database connections
        DatabaseMixin.setup(settings)

        #settings["login_url"] = "/auth/login"
        #settings["autoescape"] = None
        cyclone.web.Application.__init__(self, handlers, **settings)