def setup_handlers(web_app):
env_name = 'production'
config = config_for_env(env_name, web_app.settings['base_url'])
define('config', config)
settings = dict(
debug=True,
serve_traceback=True,
compiled_template_cache=False,
template_path=os.path.join(os.path.dirname(__file__), 'static/'),
static_path=os.path.join(os.path.dirname(__file__), 'static/'),
# Ensure static urls are prefixed with the base url too
static_url_prefix=config['URL'] + 'static/',
)
web_app.settings.update(settings)
socket_url = url_path_join(config['URL'], r'socket/(\S+)')
host_pattern = '.*'
route_pattern = url_path_join(config['URL'], '/interact')
web_app.add_handlers(host_pattern, [
(route_pattern, LandingHandler),
(route_pattern + '/', LandingHandler),
(socket_url, RequestHandler)
])
评论列表
文章目录