DjangoBlog-部署记录


目录:

1 安装mysql,nginx,supervisorctl

yum update
yum install mysql
yum install supervisor 
yum install nginx 
sudo reboot 

2 安装py环境

# 下载 miniconda
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
# 安装
bash ./Miniconda3-latest-Linux-x86_64.sh

3 创建数据库

mysql -uroot
CREATE DATABASE `djangoblog` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */;
# 1、通过navicat 手动导出 mysql数据-()
# 2、通过navicat 手动导入 mysql数据

4 修改nginx配置、重启

nginx -s stop
nginx -c ./bin/nginx.conf # 需要修改为绝对路径
nginx -s reload

4 修改supervisorctl配置、重启

djangoblog.ini 放在 /etc/supervisord.d/ 目录下面

supervisord -c /etc/supervisord.conf
supervisorctl reload
python3 ./manage.py rebuild_index
# 重新更新索引
python3 ./manage.py update_index