W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
CherryPy自帶Web(HTTP)服務(wù)器。 這就是為什么CherryPy是自包含的,允許用戶在獲取庫的幾分鐘內(nèi)運行CherryPy應(yīng)用程序。
web server充當(dāng)應(yīng)用程序的網(wǎng)關(guān),在此幫助下,所有請求和響應(yīng)都保持跟蹤。
要啟動Web服務(wù)器,用戶必須進行以下調(diào)用 -
cherryPy.server.quickstart()
internal engine of CherryPy的internal engine of CherryPy負責(zé)以下活動 -
該框架帶有自己的配置系統(tǒng),允許您參數(shù)化HTTP服務(wù)器。 配置的設(shè)置可以存儲在語法接近INI格式的文本文件中,也可以存儲為完整的Python字典。
要配置CherryPy服務(wù)器實例,開發(fā)人員需要使用設(shè)置的全局部分。
global_conf = {
'global': {
'server.socket_host': 'localhost',
'server.socket_port': 8080,
},
}
application_conf = {
'/style.css': {
'tools.staticfile.on': True,
'tools.staticfile.filename': os.path.join(_curdir, 'style.css'),
}
}
This could be represented in a file like this:
[global]
server.socket_host = "localhost"
server.socket_port = 8080
[/style.css]
tools.staticfile.on = True
tools.staticfile.filename = "/full/path/to.style.css"
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: