nginx和python3.4 下载源码编码安装,这就略过了,下面主要记录下uwsgi的安装和django配置过程
[root@xmail src]# [root@xmail src]# ln -s /usr/local/python/bin/python3 /usr/local/bin/[root@xmail src]# tar -vxf uwsgi-2.0.9.tar.gz[root@xmail src]# cd uwsgi-2.0.9[root@xmail uwsgi-2.0.9]# python3 setup.py install[root@xmail uwsgi-2.0.9]# /usr/local/python/bin/uwsgi --version2.0.9[root@xmail uwsgi-2.0.9]# ln -s /usr/local/python/bin/uwsgi /usr/local/bin/[root@xmail uwsgi-2.0.9]# uwsgi --version2.0.9
安装好了uwsgi,现在测试下uwsgi是否正常.建立一个test.py,内容如下
python2.x
# coding: utf-8def application(env, start_response): start_response('200 OK', [('Content-Type','text/html')]) return ["Hello World"]
python3.x
# coding: utf-8def application(env, start_response): start_response('200 OK', [('Content-Type','text/html')]) return [b"Hello World"]
运行 uwsgi --http :8008 --wsgi-file test.py
然后通过http://127.0.0.1:8008 访问提示 Hello World 说明配置成功