首頁 > 軟體

Ubuntu 16.04 LTS Django虛擬開發環境設定

2020-06-16 17:06:37

作業系統:Ubuntu 16.04 LTS

注意:系統自帶2個版本的Python,一個是python2.7,一個是python3.5,我只需要在python3.5下安裝venv虛擬環境

shell命令:

sudo apt-get install python3-venv

然後,等待安裝結束,在shell執行命令:

~$ python3 -m venv DjangoENV
~$ cd DjangoENV/
~$ source bin/activate

進入venv虛擬環境,很乾淨,清爽,接著執行shell命令:

(DjangoENV) warlock921@warlock921-desktop:~$ pip3 list
Django (1.11.5)
pip (8.1.1)
pkg-resources (0.0.0)
pytz (2017.2)
setuptools (20.7.0)
(DjangoENV) warlock921@warlock921-desktop:~$

開始安裝django,shell命令:

(DjangoENV) warlock921@warlock921-desktop:~/DjangoENV$ pip3 install django
Collecting django
  Downloading https://pypi.doubanio.com/packages/18/2d/b477232dd619d81766064cd07ba5b35e956ff8a8c5c5d41754e0392b96e3/Django-1.11.5-py2.py3-none-any.whl (6.9MB)
    100% |████████████████████████████████| 7.0MB 12.1MB/s
Collecting pytz (from django)
  Downloading https://pypi.doubanio.com/packages/55/62/e7cd0e15b76062d298413f14bb4ec3cd8568a22d274427f9c3c7286969f4/pytz-2017.2-py2.py3-none-any.whl (484kB)
    100% |████████████████████████████████| 491kB 5.5MB/s
Installing collected packages: pytz, django
Successfully installed django-1.11.5 pytz-2017.2

安裝完成,大功告成!

Nginx+uWSGI+Django+Python 應用架構部署  http://www.linuxidc.com/Linux/2015-10/124183.htm

Ubuntu Server 14.04.2 LTS 設定 Nginx + Uwsgi + Django  http://www.linuxidc.com/Linux/2015-04/116397.htm

Flask+uWSGI+Nginx+Ubuntu部署教學 http://www.linuxidc.com/Linux/2016-06/132690.htm

Ubuntu 16.04下安裝部署 Nginx+uWSGI+Django1.9.7  http://www.linuxidc.com/Linux/2016-07/133484.htm

Ubuntu 16.10 下部署Django+uWSGI+Nginx伺服器  http://www.linuxidc.com/Linux/2017-05/143661.htm

Nginx+uWSGI+Django在Ubuntu下的部署  http://www.linuxidc.com/Linux/2016-07/133490.htm

uWSGI+Nginx+Django安裝和設定  http://www.linuxidc.com/Linux/2017-03/141822.htm

Ubuntu下通過Nginx部署Django  http://www.linuxidc.com/Linux/2017-09/147165.htm

本文永久更新連結地址http://www.linuxidc.com/Linux/2017-09/147174.htm


IT145.com E-mail:sddin#qq.com