标签:
pip install django
create django project
django-admin.py startproject mysite
cd mysite
install uwsgi (rhel 6.X: yum install uwsgi)
pip install uwsgi
create test.py
# test.py def application(env, start_response): start_response(‘200 OK‘, [(‘Content-Type‘,‘text/html‘)]) return [b"Hello World"] # python3 #return ["Hello World"] # python2
run uwsgi
uwsgi --http :8000 --wsgi-file test.py
now test django project
python manage.py runserver 0.0.0.0:8000
and
uwsgi --http :8000 --module mysite.wsgi
都能显示: It worked
yum install nginx
systemctl start nginx.service
拷贝文件到你的项目中
https://github.com/nginx/nginx/blob/master/conf/uwsgi_params
标签:
原文地址:http://www.cnblogs.com/zhaogaolong/p/5257885.html