Centos installation Django2.1

Source: Internet
Author: User

First, the Environment preparation

1.1 Server System

Centos7

1.2. Required Tools

Python3 (theDjango 2.0 version is based on the Python3 version, so install Python3 is required)

Setuptools (>24.0)

PIP3 (18.1)

Second, installation


2.1 Installing Python3

: https://www.python.org/ftp/python/3.7.0/

Installation commands

Tar zvxf python-3.7.0.tgz

CD python3.7.0/

./configure-prefix=/usr/local/python3.7

Make && make install

Mv/usr/bin/python/urs/bin/python_bak the system's existing Python backup

Add a new link ln-s/usr/local/python3.7/bin/python3.7/usr/bin/python

Run Python

Indicates successful installation as shown

2.2 Changing Yum

Python2 will not run after upgrading to Python3, as follows:

Workaround: Vim/usr/bin/yum Modify the first behavior:

When the following error occurs:

File "/usr/bin/yum", line 30
Except Keyboardinterrupt, E:
^
Syntaxerror:invalid syntax

Workaround: Vim/usr/libexec/urlgrabber-ext-down Modify the first behavior:

2.3 Installing Setuptools

: Https://pypi.org/project/setuptools

Installation commands

Unzip Setuptools-40.4.3.zip

CD setuptools-40.4.3

Python setup.py Install

2.4 Installing PIP3

: https://pypi.org/project/pip/

Installation commands

Tar zvxf pip-18.1.tar.gz

CD pip-18.1

Python setup.py Install

Ln-s/USR/LOCAL/PYTHON3.7/BIN/PIP3/USR/BIN/PIP3

2.5 Installing Django

PIP3 Install django==2.1.2

2.6 Verification Results:

As above on behalf of Django installation completed

django2.0 Chinese document as shown in the link: https://docs.djangoproject.com/zh-hans/2.0/

Centos installation Django2.1

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.