首頁 > 軟體

Python-2.7.11+Django-1.9.4安裝設定

2020-06-16 17:43:27

Python-2.7.11+Django-1.9.4安裝設定

1.去python官網下載2.7的最新版本

https://www.python.org/downloads

1.1 解壓Python-2.7.11.tgz

tar xvf Python-2.7.11.tgz

1.2 編譯安裝

cd Python-2.7.11
./configure --prefix=/usr/local/python-2.7.11
make && make install

1.3 把命令加入環境變數

ln -s /usr/local/python-2.7.11/bin/python2.7 /usr/bin/python2.7

2.安裝 setuptools 20.3.1

2.1 下載原始碼包安裝方式

下載地址 https://pypi.python.org/pypi/setuptools#code-of-conduct
tar xvf setuptools-20.3.1.tar.gz
cd setuptools-20.3.1
python setup.py install

2.2 線上安裝方式

wget https://bootstrap.pypa.io/ez_setup.py -O - | python2.7 - --user

3.安裝Django-1.9.4

解壓
tar xvf Django-1.9.4.tar.gz

安裝
cd Django-1.9.4
python2.7 setup.py install

4.測試,匯入django模組

python2.7 
Python 2.7.11 (default, Mar 23 2016, 11:35:38) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> 

Ubuntu 14.04下Django+MySQL安裝部署全過程 http://www.linuxidc.com/Linux/2016-02/128714.htm

Django1.8返回json字串和接收post的json字串內容  http://www.linuxidc.com/Linux/2015-07/120226.htm

如何使用 Docker 元件開發 Django 專案?  http://www.linuxidc.com/Linux/2015-07/119961.htm

Ubuntu Server 12.04 安裝Nginx+uWSGI+Django環境 http://www.linuxidc.com/Linux/2012-05/60639.htm 

Django+Nginx+uWSGI 部署 http://www.linuxidc.com/Linux/2013-02/79862.htm 

Django實戰教學 http://www.linuxidc.com/Linux/2013-09/90277.htm 

Django Python MySQL Linux 開發環境搭建 http://www.linuxidc.com/Linux/2013-09/90638.htm 


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