Python 3.5.3 Django 1.11 Selenium 3.4.0 Gunicorn 19.7.1
manage.py runserver
manage.py test
python manage.py functional_tests.py
manage.py test functional_tests
manage.py test [appname]
manage.py test functional_tests.test_list_item_validation.ItemValidationTest.test_cannot_add_duplicate_items
manage.py makemigrations
manage.py migrate
manage.py migrate --noinput
manage.py collectstatic
相关设置在settings.py下的STATIC_URL与STATIC_ROOT
sudo useradd -m -s /bin/bash elspeth
用户名为elspeth, -m表示创建家目录, -s表示默认能用bash
sudo usermod -a -G sudo elspeth
把elspeth添加到sudo用户组
sudo passwd elspeth
su - elspeth
sudo apt-get install nginx
在etc/ngnix下设置conf
sudo service nginx start
sudo service nginx stop
sudo apt-get install git python3 python3-pip
sudo pip3 install virtualenv
virtualenv venv
该命令会新建一个文件夹venv,文件夹中是自成一体的Python环境
Linux
source venv/bin/activate
Window下是运行venv/Scripts下的activatecd venv/Scripts
activate
pip install django==1.11
pip freeze | requirments.txt
pip install -r requirments.txt
deactivate
pip install gunicorn
gunicorn superlists.wsgi:application
在etc/ngnix下设置conf
在etc/init/gunicorn-tdd-django
pip install fabric
仅支持Python2.5-2.7
fab <function_name>,host=SERVER_ADDRESS
- 使用LESS定制Bootstrap
- 使用{% static %}模板标签
- 客户端打包工具,例如bower
- 其它部署工具:Absible, Vagrant, Chef, Puppet, Salt, Juju