1.安装虚拟环境
sudo pip3 install virtualenv
sudo pip3 install virtualenvwrapper
2.为 zsh 配置虚拟环境
① sudo vim .zshrc
② 然后添加 source /usr/local/bin/virtualenvwrapper.sh
③source .zshrc
3. 创建虚拟环境
mkvirtualenv ***
4.拉取代码
git clone --
5.安装环境
pip install -r requirements.txt
① 如出现错误 mysql_config not found
解决办法:sudo apt install libmysqlclient-dev
②安装redis
sudo apt install redis-server
③配置redis 本地网址解析
sudo vim /etc/hosts
输入 127.0.0.1 mc.sso.cn
6. 配置项目
① cd sso_service
② mkdir -p logs/apps
③ vim sso_service/config/me.py
_HOST_ENV = 'dev' def get_env(): return _HOST_ENV
④ mysql -uroot -p < docs/dbconf/sso_db_setup.sql
⑤ python manage.py migrate
7. 安装uwsgi
pip install uwsgi
启动命令 uwsgi --ini *.ini
8. 安装nginx
apt install nginx