切分与识别
基本思路是通过virtualenvwrapper在本地创建一个独立的env环境,用docker-compose来启用一些项目所需的容器服务,比如mysql,redis等等。并将端口映射到本地。
略
cd /tmp
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
pip install --ignore-installed six virtualenvwrapper
source /usr/local/bin/virtualenvwrapper.sh
mkvirtualenv character --python=python3
workon character
pip install -r requirements.txt
pip install https://github.com/CoinLQ/xadmin/archive/master.zip
pip install https://github.com/CoinLQ/db_file_storage/archive/master.zip
略
docker-compose up -d
docker-compose run web_lqcharacter /usr/local/bin/python manage.py makemigrations //docker-compose 1.5.2 环境下
docker-compose exec web_lqcharacter /usr/local/bin/python manage.py makemigrations
docker-compose exec web_lqcharacter /usr/local/bin/python manage.py migrate
python manage.py makemigrations
python manage.py migrate
python manage.py loaddata ./fixtures/initial_data.json
把下列环境变量加入你的rc文件中,
export OSS_API_KEY=<input>
export OSS_API_SECRET=<input>
python manage.py runserver
cmd> python manage.py collectstatic --settings=lqcharacter.ci_settings
conf> DJANGO_SETTINGS_MODULE=lqcharacter.ci_settings coverage run manage.py test