CentOS7下的Django2集成部署二:Nginx1.14.2、Mysql5.7和Python3.7的安装

nginx

  •   安装依赖
    yum install -y gcc pcre-devel zlib zlib-devel
  •   默认安装
    rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
    yum install -y nginx
  •   配置
    [root@gz-ct76211 ~]# nginx -v
    nginx version: nginx/1.14.2
    [root@gz-ct76211 ~]# systemctl enable nginx
    Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.
    [root@gz-ct76211 ~]# systemctl start nginx
    [root@gz-ct76211 ~]# lsof -i :80
    COMMAND   PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
    nginx   11227  root    6u  IPv4  34477      0t0  TCP *:http (LISTEN)
    nginx   11228 nginx    6u  IPv4  34477      0t0  TCP *:http (LISTEN)
  •   调试
    [root@gz-ct76211 ~]# elinks http://localhost --dump
                                   Welcome to nginx!
    
       If you see this page, the nginx web server is successfully installed and
       working. Further configuration is required.
    
       For online documentation and support please refer to [1]nginx.org.
       Commercial support is available at [2]nginx.com.
    
       Thank you for using nginx.
    
    References
    
       Visible links
       1. http://nginx.org/
       2. http://nginx.com/

    此刻nginx基本上就已经可以正常工作了!调试过程中,为了避免干扰,请务必把selinux和防火墙 firewalld或iptables 都关闭了

mysql

  •   安装依赖
    yum -y install ncurses-devel gcc-* bzip2-*
  •   编译安装
    • cmake
      #获取cmake
      wget https://github.com/Kitware/CMake/releases/download/v3.13.1/cmake-3.13.1.tar.gz
      #解压
      tar xf cmake-3.13.1.tar.gz
      #进入程序目录
      cd cmake-3.13.1
      #编译并安装
      ./configuare
      
      make
      
      make install
    • boost
      #获取boost1.59
      wget https://nchc.dl.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.bz2
      #解压
      tar xf boost_1_59_0.tar.bz2
      #移动目录给mysql编译使用
      mv boost_1_59_0 /usr/local/boost
    • mysql
      #获取mysql
      wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.24.tar.gz
      tar xf
      mysql-5.7.24.tar.gz
      cd mysql-5.7.24

      用cmake编译,耗时有点久编译安装差不多1小时左右

      cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql 
      -DMYSQL_DATADIR=/usr/local/mysql/data/ 
      -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock 
      -DDOWNLOAD_BOOST=0 
      -DWITH_INNODBBASE_STORAGE_ENGINE=1 
      -DENABLE_LOCAL_INFILE=1 
      -DEXTRA_CHARSETS=all 
      -DDEFAULT_CHARSET=utf8 
      -DDEFAULT_COLLATION=utf8_general_ci -DWITH_DEBUG=0 
      -DWITH_EMBEDED_SERVER=0 
      -DDOWNLOAD_BOOST=1 
      -DWITH_BOOST=/usr/local/boost


      # -DMYSQL_USER=mysql 稍后新建mysql用户
      make && make install
  •   配置
    • 添加启动文件
      cp support-files/mysql.server /etc/init.d/mysql
      #授权
      chmod 755 /etc/init.d/mysql
    • 用户配置
      #添加用户
      useradd -s /sbin/nologin -r mysql
      #用户授权
      chown mysql.mysql /usr/local/mysql/ -R
    • 设置链接文件
      ln -sf /usr/local/mysql/bin/* /usr/bin/
      ln -sf /usr/local/mysql/lib/* /usr/lib/
      ln -sf /usr/local/mysql/libexec/* /usr/local/libexec
      ln -sf /usr/local/mysql/share/man/man1/* /usr/share/man/man1
      ln -sf /usr/local/mysql/share/man/man8/* /usr/share/man/man8
    • 配置文件
      #数据目录
      

      [root@home-ct75211 mysql-5.7.24]# mkdir -pv /usr/local/mysql/data
      mkdir: created directory ‘/usr/local/mysql/data’

       配置/etc/my.cnf

       1 [mysqld]
       2 datadir=/usr/local/mysql/data
       3 socket=/usr/local/mysql/mysql.sock
       4 # Disabling symbolic-links is recommended to prevent assorted security risks
       5 symbolic-links=0
       6 # Settings user and group are ignored when systemd is used.
       7 # If you need to run mysqld under a different user or group,
       8 # customize your systemd unit file for mariadb according to the
       9 # instructions in http://fedoraproject.org/wiki/Systemd
      10 
      11 [mysqld_safe]
      12 log-error=/var/log/mysql.log
      13 pid-file=/var/run/mysql.pid
      14 
      15 #
      16 # include all files from the config directory
      17 #
      18 !includedir /etc/my.cnf.d
      vim /etc/my.cnf
    • 生成root密码
      #生成默认密码
      /usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/

      启动MySQL

      /etc/init.d/mysql start

      设置root密码

      mysql_secure_installation
       1 [root@home-ct75211 mysql-5.7.24]# mysql_secure_installation
       2 
       3 Securing the MySQL server deployment.
       4 
       5 Enter password for user root: 
       6 
       7 The existing password for the user account root has expired. Please set a new password.
       8 
       9 New password: 
      10 
      11 Re-enter new password: 
      12 
      13 VALIDATE PASSWORD PLUGIN can be used to test passwords
      14 and improve security. It checks the strength of password
      15 and allows the users to set only those passwords which are
      16 secure enough. Would you like to setup VALIDATE PASSWORD plugin?
      17 
      18 Press y|Y for Yes, any other key for No: n
      19 Using existing password for root.
      20 Change the password for root ? ((Press y|Y for Yes, any other key for No) : y
      21 
      22 New password: 
      23 
      24 Re-enter new password: 
      25 By default, a MySQL installation has an anonymous user,
      26 allowing anyone to log into MySQL without having to have
      27 a user account created for them. This is intended only for
      28 testing, and to make the installation go a bit smoother.
      29 You should remove them before moving into a production
      30 environment.
      31 
      32 Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
      33 Success.
      34 
      35 
      36 Normally, root should only be allowed to connect from
      37 'localhost'. This ensures that someone cannot guess at
      38 the root password from the network.
      39 
      40 Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
      41 Success.
      42 
      43 By default, MySQL comes with a database named 'test' that
      44 anyone can access. This is also intended only for testing,
      45 and should be removed before moving into a production
      46 environment.
      47 
      48 
      49 Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
      50  - Dropping test database...
      51 Success.
      52 
      53  - Removing privileges on test database...
      54 Success.
      55 
      56 Reloading the privilege tables will ensure that all changes
      57 made so far will take effect immediately.
      58 
      59 Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
      60 Success.
      61 
      62 All done! 
      View Code
  •   调试
     1 [root@home-ct75211 mysql-5.7.24]# mysql -u root -p
     2 Enter password: 
     3 Welcome to the MySQL monitor.  Commands end with ; or g.
     4 Your MySQL connection id is 5
     5 Server version: 5.7.24 Source distribution
     6 
     7 Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
     8 
     9 Oracle is a registered trademark of Oracle Corporation and/or its
    10 affiliates. Other names may be trademarks of their respective
    11 owners.
    12 
    13 Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
    14 
    15 mysql> show databases;
    16 +--------------------+
    17 | Database           |
    18 +--------------------+
    19 | information_schema |
    20 | mysql              |
    21 | performance_schema |
    22 | sys                |
    23 +--------------------+
    24 4 rows in set (0.00 sec)
    25 
    26 mysql> 
    mysql -u root -p

python

  •   安装依赖
    yum install -y gcc-* openssl-* libffi-devel sqlite-devel
  •   下载安装
    wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tar.xz
    #解压
    tar xf Python-3.7.1.tar.xz
    #进入目录
    cd Python-3.7.1
    #配置
    ./configure --enable-optimizations --with-openssl=/usr/bin/openssl
    #编译安装
    make -j4
    make install
  •   调试

    ... ...

    Collecting setuptools
    Collecting pip
    Installing collected packages: setuptools, pip
    Successfully installed pip-10.0.1 setuptools-39.0.1
    [root@home-ct75211 Python-3.7.1]# python3
    Python 3.7.1 (default, Dec 14 2018, 11:39:37)
    [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>>

  •   升级pip
     1 [root@home-ct75211 ~]# pip3 install --upgrade pip
     2 pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
     3 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
     4 Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
     5 Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
     6 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
     7 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
     8 Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
     9 Requirement already up-to-date: pip in /usr/local/lib/python3.7/site-packages (10.0.1)
    10 pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
    11 Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
    pip3 install --upgrade pip

    其实在编译的时候已经有提示了,下面把Module/Setup重新编辑下

    [root@home-ct75211 Python-3.7.1]# vim Modules/Setup
    #把下边这段话的#去掉
    211 SSL=/usr/local/ssl 212 _ssl _ssl.c 213 -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl 214 -L$(SSL)/lib -lssl -lcrypto

    再次  make -j4 && make install ,然后再升级pip

    [root@home-ct75211 Python-3.7.1]# pip3 install --upgrade pip
    Collecting pip
    ... ...
    Installing collected packages: pip
      Found existing installation: pip 10.0.1
        Uninstalling pip-10.0.1:
          Successfully uninstalled pip-10.0.1
    Successfully installed pip-18.1
    pip3 install --upgrade pip
  •        virtualenv
    [root@home-ct75211 Python-3.7.1]# pip3 install virtualenv
    Collecting virtualenv
      Downloading 
    ... ...
    Installing collected packages: virtualenv
    Successfully installed virtualenv-16.1.0
    pip3 install virtualenv
    #创建py3web虚拟环境
    [root@home-ct75211 ~]# virtualenv -p python3 py3web
    Running virtualenv with interpreter /usr/local/bin/python3
    Using base prefix '/usr/local'
    New python executable in /root/py3web/bin/python3
    Also creating executable in /root/py3web/bin/python
    Installing setuptools, pip, wheel...
    done.
    #进入py3web虚拟环境,顺便安装django2
    [root@home-ct75211 ~]# source py3web/bin/activate
    (py3web) [root@home-ct75211 ~]# pip3 install django==2.*
    ... ...
    Installing collected packages: pytz, django
    Successfully installed django-2.1.4 pytz-2018.7
    #退出虚拟环境
    (py3web) [root@home-ct75211 ~]# deactivate
    [root@home-ct75211 ~]# 
  •        uwsgi
    • pip安装
      [root@home-ct75211 ~]# pip3 install uwsgi
      Collecting uwsgi
        Downloading 
      ... ...
      Installing collected packages: uwsgi
        Running setup.py install for uwsgi ... done
      Successfully installed uwsgi-2.0.17.1
    • 制作启动脚本
      [root@home-ct75211 ~]# mkdir /etc/uwsgi
      [root@home-ct75211 ~]# vim /etc/uwsgi/uwsgi.ini
      [uwsgi]
      uid = root
      gid = root
      socket = 127.0.0.1:21190
      # 启动主进程
      master = true 
      # 多站模式
      vhost = true 
      # 多站模式时不设置⼊⼝模块和⽂件
      no-site = true 
      # ⼦进程数
      workers = 2
      # 平滑的重启
      reload-mercy = 10
       # 退出、重启时清理⽂件
      vacuum = true
      # 开启10000个进程后, ⾃动respawn下
      max-requests = 1000 
      # 将进程的总内存量控制在512M
      limit-as = 512 
      buffer-size = 30000
      # pid⽂件,⽤于下⾯的脚本启动、停⽌该进程
      pidfile = /var/run/uwsgi9090.pid 
      daemonize = /var/log/uwsgi9090.log
      
      /etc/uwsgi/uwsgi.ini
      /etc/uwsgi/uwsgi.ini
      # 启动
      [root@home-ct75211 ~]# uwsgi --ini /etc/uwsgi/uwsgi.ini
      [uWSGI] getting INI configuration from /etc/uwsgi/uwsgi.ini
      # 关闭
      [root@home-ct75211 ~]# cat /var/run/uwsgi21190.pid 
      26516
      [root@home-ct75211 ~]# kill -9 26516

      加入脚本管理

      #!/bin/sh
        DESC="uwsgi daemon"
        NAME=uwsgi
        DAEMON=/usr/local/bin/uwsgi
        CONFIGFILE=/etc/uwsgi/$NAME.ini
        PIDFILE=/var/run/${NAME}21190.pid
        SCRIPTNAME=/etc/init.d/$NAME
        FIFOFILE=/tmp/uwsgififo
        set -e
        [ -x "$DAEMON" ] || exit 0
      
        do_start() {
        if [ ! -f $PIDFILE ];then
            $DAEMON $CONFIGFILE || echo -n "uwsgi  running"
        else
            echo "The PID is exist..."
        fi
        }
      
        do_stop() {
        if [ -f $PIDFILE ];then
            $DAEMON --stop $PIDFILE || echo -n "uwsgi not running"
            rm -f $PIDFILE
            echo "$DAEMON STOPED."
        else
            echo "The $PIDFILE doesn't found"
        fi
        }
      
        do_reload() {
        if [ -p $FIFOFILE ];then
            echo w > $FIFOFILE
        else
            $DAEMON --touch-workers-reload $PIDFILE || echo -n "uwsgi can't reload"
        fi
        }
      
        do_status() {
            ps aux|grep $DAEMON
        }
      
        case "$1" in
        status)
            echo -en "Status $NAME: 
      "
            do_status
        ;;
        start)
            echo -en "Starting $NAME: 
      "
            do_start
        ;;
        stop)
            echo -en "Stopping $NAME: 
      "
            do_stop
        ;;  
        reload|graceful)
            echo -en "Reloading $NAME: 
      "
            do_reload
        ;;
        *)
            echo "Usage: $SCRIPTNAME {start|stop|reload}" >&2
            exit 3
        ;;
        esac
        exit 0
      
      vim /etc/init.d/uwsgi
      vim /etc/init.d/uwsgi
      #授权
      [root@home-ct75211 html]# chmod 755 /etc/init.d/uwsgi
      
      #关闭
      [root@home-ct75211 html]# /etc/init.d/uwsgi stop
      Stopping uwsgi: 
      /usr/local/bin/uwsgi STOPED.
      #启动
      [root@home-ct75211 html]# /etc/init.d/uwsgi start
      Starting uwsgi: 
      [uWSGI] getting INI configuration from /etc/uwsgi/uwsgi.ini
      #查看
      [root@home-ct75211 html]# netstat -ntpl
      Active Internet connections (only servers)
      Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
      tcp        0      0 127.0.0.1:21190         0.0.0.0:*               LISTEN      26572/uwsgi         
      tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      26560/nginx: master 
      tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1081/sshd           
      tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1380/master         
      tcp6       0      0 :::3306                 :::*                    LISTEN      2425/mysqld         
      tcp6       0      0 :::22                   :::*                    LISTEN      1081/sshd           
      tcp6       0      0 ::1:25                  :::*                    LISTEN      1380/master   

       还可以再升级下,加入开机自启

      chkconfig --add /etc/init.d/uwsgi
      [root@home-ct75211 ~]# cd /etc/init.d
      [root@home-ct75211 init.d]# chkconfig --level 2345 uwsgi on
      [root@home-ct75211 init.d]# chkconfig --list
      
      Note: This output shows SysV services only and does not include native
            systemd services. SysV configuration data might be overridden by native
            systemd configuration.
      
            If you want to list systemd services use 'systemctl list-unit-files'.
            To see services enabled on particular target use
            'systemctl list-dependencies [target]'.
      
      jenkins            0:off    1:off    2:on    3:on    4:on    5:on    6:off
      jexec              0:off    1:on     2:on    3:on    4:on    5:on    6:off
      netconsole         0:off    1:off    2:off   3:off   4:off   5:off   6:off
      network            0:off    1:off    2:on    3:on    4:on    5:on    6:off
      uwsgi              0:off    1:off    2:on    3:on    4:on    5:on    6:off
    • 整合Nginx测试
      #进入虚拟环境
      [root@home-ct75211 ~]# source ~/py3web/bin/activate
      #创建my_django项目
      
      (py3web) [root@home-ct75211 ~]# django-admin.py startproject my_django
      (py3web) [root@home-ct75211 ~]# cd my_django
      (py3web) [root@home-ct75211 my_django]# ll
        total 4
        -rw-r--r--. 1 root root 0 Dec 14 21:37 db.sqlite3
        -rwxr-xr-x. 1 root root 541 Dec 14 21:35 manage.py
        drwxr-xr-x. 3 root root 93 Dec 14 21:37 my_django
      # 用Django的内置web服务访问下
      (py3web) [root@home-ct75211 my_django]# python manage.py runserver 192.168.23.211:8000
      Performing system checks...
      
      System check identified no issues (0 silenced).
      
      You have 15 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
      Run 'python manage.py migrate' to apply them.
      
      December 15, 2018 - 02:46:48
      Django version 2.1.4, using settings 'my_django.settings'
      Starting development server at http://192.168.23.211:8000/
      [root@home-ct75211 ~]# elinks http://192.168.23.211:8000/ --dump
                                    DisallowedHost at /
      
       Invalid HTTP_HOST header: '192.168.23.211:8000'. You may need to add '192.168.23.211' to ALLOWED_HOSTS.
      。。。
      需要ALLOWED_HOSTS加入* vim my_django/settings.py  ALLOWED_HOSTS = ['*'] ,编辑后再访问下,就可以了
      [root@home-ct75211 ~]# elinks http://192.168.23.211:8000/ --dump
      [1]django
      
         View [2]release notes for Django 2.1
      
      The install worked successfully! Congratulations!
      
         You are seeing this page because [3]DEBUG=True is in your settings file
         and you have not configured any URLs.
      
          [4]Django Documentation
      
         Topics, references, & how-to's
      
          [5]Tutorial: A Polling App
      
         Get started with Django
      
          [6]Django Community
      
         Connect, get help, or contribute
      elinks http://192.168.23.211:8000/ --dump
      # 用Nginx来访问
      (py3web) [root@home-ct75211 ~]# mv my_django /usr/share/nginx/html
      (py3web) [root@home-ct75211 ~]# vim /etc/nginx/conf.d/my_django.conf
      server {
              listen       80;
              server_name  www.my-django.cc;
      
              #charset koi8-r;
      
              #access_log  logs/host.access.log  main;
      
              location / {
                  include  uwsgi_params;
                  uwsgi_pass  127.0.0.1:21190;
                  uwsgi_param UWSGI_SCRIPT my_django.wsgi;
                  uwsgi_param UWSGI_CHDIR  /usr/share/nginx/html/my_django;
                  index  index.html index.htm;
                  client_max_body_size 35m;
                  #uwsgi_cache_valid 1m;
                  #uwsgi_temp_file_write_size 64k;
                  #uwsgi_busy_buffers_size 64k;
                  #uwsgi_buffers 8 64k;
                  #uwsgi_buffer_size 64k;
                  #uwsgi_read_timeout 300;
                  #uwsgi_send_timeout 300;
                  #uwsgi_connect_timeout 300;
              }
      
              #error_page  404              /404.html;
      
              # redirect server error pages to the static page /50x.html
              #
              error_page   500 502 503 504  /50x.html;
              location = /50x.html {
                  root   html;
              }
      
      
          }
      
      /etc/nginx/conf.d/my_django.conf
      /etc/nginx/conf.d/my_django.conf

       (py3web) [root@home-ct75211 ~]# systemctl restart nginx

      配置本地域名

      1 (py3web) [root@home-ct75211 ~]# vim /etc/hosts
      2 
      3 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
      4 ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
      5 127.0.0.1       www.my-django.cc
      6 127.0.0.1       www.my-nginx.cc
      7 127.0.0.1       www.my-blog.cc
      (py3web) [root@home-ct75211 ~]# vim /etc/hosts

      由于这里使用的是virtualenv环境,在uwsgi的配置文件中还要加入虚拟环境的pythonpath

      [uwsgi]
      uid = root
      gid = root
      socket = 127.0.0.1:21190
      master = true 
      vhost = true 
      no-site = true 
      workers = 2 
      reload-mercy = 10 
      vacuum = true 
      max-requests = 1000 
      limit-as = 512 
      buffer-size = 30000
      pidfile = /var/run/uwsgi21190.pid 
      daemonize = /var/log/uwsgi21190.log
      pythonpath = /root/py3web/lib/python3.7/site-packages
      /etc/init.d/uwsgi

               重启uwsgi服务

[root@home-ct75211 ~]# /etc/init.d/uwsgi stop
Stopping uwsgi: 
/usr/local/bin/uwsgi STOPED.
[root@home-ct75211 ~]# /etc/init.d/uwsgi start
Starting uwsgi: 
[uWSGI] getting INI configuration from /etc/uwsgi/uwsgi.ini
[root@home-ct75211 ~]# elinks http://www.my-django.cc --dump
[1]django

   View [2]release notes for Django 2.1

The install worked successfully! Congratulations!

   You are seeing this page because [3]DEBUG=True is in your settings file
   and you have not configured any URLs.

    [4]Django Documentation

   Topics, references, & how-to's

    [5]Tutorial: A Polling App

   Get started with Django

    [6]Django Community

   Connect, get help, or contribute

References

   Visible links
   1. https://www.djangoproject.com/
   2. https://docs.djangoproject.com/en/2.1/releases/
   3. https://docs.djangoproject.com/en/2.1/ref/settings/#debug
   4. https://docs.djangoproject.com/en/2.1/
   5. https://docs.djangoproject.com/en/2.1/intro/tutorial01/
   6. https://www.djangoproject.com/community/

基本上的部署环境已经大功告成了!!!

原文地址:https://www.cnblogs.com/zhujingxiu/p/10119317.html