Home > Backend Development > PHP Tutorial > django uwsgi nginx

django uwsgi nginx

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-29 09:07:25
Original
1083 people have browsed it

Reference materials:

uwsgi official information:

* http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

http://uwsgi-docs.readthedocs.org/ en/latest/WSGIquickstart.html

Command line browser for testing: http://www.geekfan.net/9045/

Others’ notes (uwsgi compilation and installation):

*http ://blog.csdn.net/chenggong2dm/article/details/43937433

The key points are as follows:

virtualenv uwsgi-tutorial
<span>cd </span>uwsgi-tutorial
<span>source </span>bin/activate
Copy after login
pip install Django
django-admin.py startproject mysite
<span>cd </span>mysite
Copy after login
pip install uwsgi
如果pip安装报错,则编辑安装如下:
<pre class="brush:php;toolbar:false"><span>wget http://projects.unbit.it/download/uwsgi-latest.tar.gz
tar zxvf uwsgi-latest.tar.gz
<span>cd</span> <dir>
make</span>
Copy after login
Test:
------------------------------------------------
Copy after login
<p>Create a file called <code><span>test.py</span></code>:</p><p></p><p></p><pre class="brush:php;toolbar:false"><span># test.py</span>
def application<span>(</span>env, start_response<span>)</span>:
    start_response<span>(</span><span>'200 OK'</span>, <span>[(</span><span>'Content-Type'</span>,<span>'text/html'</span><span>)])</span><span>return</span><span>[</span>b<span>"Hello World"</span><span>]</span><span># python3</span><span>#return ["Hello World"] # python2</span>
Copy after login
path/uwsgi --http :8000 --wsgi-file test.py
可用命令行浏览器本机测试,或网络上客户端直接测试均可
Copy after login
------------------------------------------------
Copy after login
[root@VM_151_192_centos mysite]# ./uuu/uwsgi --http :8 000 --module mysite.wsgi

The above introduces django uwsgi nginx, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template