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