首页 > 其他 > 详细

nginx+uwsgi 部署django

时间:2018-08-23 18:19:45      阅读:138      评论:0      收藏:0      [点我收藏+]

安装nginx:
sudo apt-get install nginx

测试nginx:
打开浏览器 输入: localhost:80 (默认80端口)

安装uwsgi:
进入虚拟环境安装: pip install uwsgi

测试uwsgi:
项目环境中 创建test.py文件:

def application(environ, start_response):
status = ‘200 OK‘
output = ‘Hello World! powerde by wsgi‘
response_headers = [(‘Content-type‘, ‘text/plain‘),(‘Content-Length‘, str(len(output)))]
start_response(status, response_headers)
return [output]

运行 : uwsgi --http :8001 --wsgi-file test.py
然后浏览器访问 :http://127.0.0.1:8001
显示 :Hello World! powerde by wsgi

nginx+uwsgi 部署django

原文:https://www.cnblogs.com/yushengzhou/p/9525123.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!