Ubuntu+django+nginx+uwsgi Ubuntu python django Ubuntu installs Django Ubuntu Django mysq

Source: Internet
Author: User
Tags install django pip install django
1. Install Pip

Digitalocean django nginx ubuntu 18

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, Installation Python2.7-dev

sudo apt-get install Python2.7-dev

Django ubuntu nginx

4, Installation 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 (' K OK ', [(' Content-type ', ' text/html ')])
return [B "Hello World"] # Python3
#return ["Hello World"] # Python2

6. Then enter the project directory

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

502 bad gateway nginx 1.10 3 ubuntu django 

7. Open the browser and enter the URL

127.0.0.1:8000

8. Installing MongoDB

Pip Install pym>

9. Other

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 describes the UBUNTU+DJANGO+NGINX+UWSGI, including the django,ubuntu aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.