webpy MVC 经典示例:seddit

未完成版本,供参考。An application built to combine the best aspects, ...

↑我也要推荐

webpy ssl 加密访问

发布时间:2010-12-19 21:39:26, 关注:+5803, 赞美:+5, 不爽:+8

本文标签: ssl

1: 安装openssl

2:

cd /etc/ssl


openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out
server.crt

3:

import web
from web.wsgiserver import CherryPyWSGIServer

CherryPyWSGIServer.ssl_certificate = "/etc/ssl/server.crt"
CherryPyWSGIServer.ssl_private_key = "/etc/ssl/server.key"

urls = ("/.*", "hello")

app = web.application(urls, globals())

class hello:

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

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

原文

如果你觉得本站对你有帮助,欢迎向本站赞助 :P

使用支付宝捐赠

Copyright© Python4cn(news, jobs) simple-is-better.com, 技术驱动:powered by web.py 空间主机:Webfaction

版权申明:文章转载已注明出处,如有疑问请来信咨询。本站为 python 语言推广公益网站,与 python 官方没有任何关系。

联系/投搞/留言: en.simple.is.better@gmail.com 向本站捐赠