基于 centos
升级 python
下载 python
解压
安装依赖包
./configure
make
make install
/usr/bin :
which python3.x | ln python3.x python
升级PIP pip install -U pip
- 安装 mysql
yum install mysql-server
# 设置 root 密码 ?
# 启动 mysql
service mysqld start
创建数据库
- 安装mysqlclient
# 具体步骤如下:
apt-get update
apt-get install python-pip (已经有pip命令则跳过此步骤)
apt-get install mysql-server
apt-get install mysql-client
apt-get install libmysql-dev
apt-get install libmysqlclient-dev
apt-get install python-dev
pip install mysqlclient
- 安装 django
- 更改 settings.py
allow host
# mysql 修改字符集 : http://blog.csdn.net/qq_32144341/article/details/51318390
alter database xxx default character set=utf8
- 跑起来 manage.py runserver 0.0.0.0:8080