本文共 768 字,大约阅读时间需要 2 分钟。
下载地址:
安装相关的依赖包:
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel进入解压的目录,并指定相应的安装目录:
./configure --prefix=/usr/local/python3开始安装:
make && make install设置相应的环境变量:
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/app/mysql/bin:/usr/local/python3/bin安装命令:
pip3 install django==1.11.11查看是否安装成功
[root@ops-site bin]# django-admin --version1.11.11进入相应的目录,创建testsite目录:
django-admin startproject testsite编辑settings.py文件,设置相应访问权限
ALLOWED_HOSTS = ['*']启动该站点
nohup python3 manage.py runserver 10.3.152.78:8000 &备注:nohup为后台运行,10.3.152.78(服务器的IP地址),8000为启动的端口
转载于:https://blog.51cto.com/12965094/2397294