Home > Backend Development > PHP Tutorial > Ubuntu+Django+Nginx+uWSGI ubuntu python django ubuntu

Ubuntu+Django+Nginx+uWSGI ubuntu python django ubuntu

WBOY
Release: 2016-07-29 08:53:20
Original
1038 people have browsed it

1. Install pip

sudo apt-get install python-pip

2. Install Django and create the project

pip install Django==1.9.2

django-admin.py startproject mysite

cd mysite

3 , install python2.7-dev

sudo apt-get install python2.7-dev

4. Install uwsig

sudo python2.7 -m pip install uwsgi

5. Then go to the directory to find the created project

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

6. Then enter the project directory and enter

uwsgi --http :8000 --wsgi-file test.py

7. Open the browser Tool, enter the URL

127.0.0.1:8000

8. Install mongodb

pip install pym>

9. Others

xlrd==0.9.4

10. Start the project

python manage.py runserver 127.0.0.1:8000

uwsgi --http :8000 --module mysite.wsgi

The above introduces ubuntu+Django+Nginx+uWSGI, including the content of django and ubuntu. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
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