Get Started

Cookbook

基本应用

高级应用

Sessions and user state 会话和用户状态

Utils 实用工具

Templates 模板

Testing 测试

User input 用户输入

Database 数据库

Deployment 部署

问题

如何用内置的cheerypy提供SSL支持?

解法

import web

from web.wsgiserver import CherryPyWSGIServer

CherryPyWSGIServer.ssl_certificate = "path/to/ssl_certificate"
CherryPyWSGIServer.ssl_private_key = "path/to/ssl_private_key"

urls = ("/.*", "hello")
app = web.application(urls, globals())

class hello:
    def GET(self):
        return 'Hello, world!'

if __name__ == "__main__":
    app.run()