所需软件
- Xshell6
- xftp
通过Xshell连接阿里云(这个不难,就不说了)
更改python环境
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150
下载django
sudo pip install django==2.0.2
安装mysql
sudo apt-get update sudo apt-get install mysql-server sudo mysql_secure_installation
进入数据库
mysql -u root -p
创建数据库表
create database test character set utf8;
进入manage.py 路径生成表
cd /root/myorder
python manage.py makemigrations
python manage.py migrate
更改settings.py中的配置
ALLOWED_HOSTS=['47.94.3.123','*',]
运行
python manage.py runserver 0.0.0.0:8080