Tornado服務端基本的配置文件(Python)

web_set = {
    # -------一般設置--------
    'debug': True,
    'port': 8836,
    'autoreload': True,
    'ui_modules': {},
    # 設置默認的處理函數類,如:404頁面等
    'default_handler_class': None,
    'serve_traceback': False,



    # -------模板設置-------
    'template_path': os.path.join(os.path.dirname(__file__), '../templates'),
    'compiled_template_cache': True,
    'autoescape': None,


    # -------認證安全設置-------
    # cookie標識位,用來給cookie簽名。
    'cookie_secret': '',
    'login_url': '',
    # 如果true, 跨站請求僞造(防護) 將被開啓.
    'xsrf_cookies': True,
    'xsrf_cookie_version': None,

    # -------靜態文件設置-------
    'static_hash_cache': False,
    'static_path': os.path.join(os.path.dirname(__file__), '../static'),
    'static_url_prefix': '/static/',
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章