码迷,mamicode.com
首页 > 编程语言 > 详细

Python web服务器

时间:2017-07-02 20:29:55      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:conf   eve   sgi   world   rom   services   div   ica   sky   

Python 配置wsgi接口
#
引入Python wsgi包 from wsgiref.simple_server import make_server # 撰写服务器端程序代码 def Application(envirn,start_response): start_response(200 ok,[(Content-Type,text/html)]) return <b>hello world</b> # 实例化一个监听8080端口的服务器 server = make_server(‘‘,8080,Application) # 开始监听http请求 server.serve_forever()

wsgi是将Python服务器端程序链接到web服务器的通用协议

Nginx+uwsgi配置

安装Nginx

brew install nginx 

brew services start nginx

技术分享

 

Nginx 配置文件

进入/usr/local/etc/nginx目录下,执行 sudo vim nginx.conf

参考:http://www.cnblogs.com/Lxiaolong/p/4201973.html 

安装uwsgi及配置

pip install uwsgi

参考:http://www.cnblogs.com/sky20081816/p/3398864.html

Python web服务器

标签:conf   eve   sgi   world   rom   services   div   ica   sky   

原文地址:http://www.cnblogs.com/Erick-L/p/7106883.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!