centos安裝django

來源:互聯網
上載者:User

標籤:python   pip安裝   

在centos上安裝django,應該有3種方法,pip、git、原始碼編譯安裝。

pip安裝比較單,步驟如下:


1、下載


mkdir /install/django


cd /install/django


wget https://bootstrap.pypa.io/get-pip.py


--2015-06-25 11:29:12--  https://bootstrap.pypa.io/get-pip.py

Resolving bootstrap.pypa.io... 103.245.222.175

Connecting to bootstrap.pypa.io|103.245.222.175|:443... connected.

HTTP request sent, awaiting response... 200 OK

Length: 1421845 (1.4M) [text/x-python]

Saving to: “get-pip.py”


100%[===================================================================================>] 1,421,845   21.4K/s   in 74s     


2015-06-25 11:30:30 (18.7 KB/s) - “get-pip.py” saved [1421845/1421845]


2、get-pip安裝

python get-pip.py


For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.

  Downloading pip-7.0.3-py2.py3-none-any.whl (1.1MB)

    100% |████████████████████████████████| 1.1MB 19kB/s 

Collecting setuptools

  Downloading setuptools-18.0.1-py2.py3-none-any.whl (461kB)

    100% |████████████████████████████████| 462kB 30kB/s 

Collecting wheel

  Downloading wheel-0.24.0-py2.py3-none-any.whl (63kB)

    100% |████████████████████████████████| 65kB 15kB/s 

Collecting argparse (from wheel)

  Downloading argparse-1.3.0-py2.py3-none-any.whl

Installing collected packages: pip, setuptools, argparse, wheel

Successfully installed argparse-1.3.0 pip-7.0.3 setuptools-18.0.1 wheel-0.24.0


3、pip安裝django


pip install Django==1.6


Collecting Django==1.6

/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.

  InsecurePlatformWarning

  Downloading Django-1.6-py2.py3-none-any.whl (6.7MB)

    100% |████████████████████████████████| 6.7MB 7.8kB/s 

Installing collected packages: Django

  Found existing installation: Django 1.8.2

    Uninstalling Django-1.8.2:

      Successfully uninstalled Django-1.8.2

Successfully installed Django-1.6


如果先下載過別的版本,這裡就會出現清理的資訊。這裡就是清理以前安裝過的1.8.2版本。


4、驗證一下版本

python -c "import django; print(django.get_version())"


1.6



centos安裝django

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.