python framework
Project description
### 基础开发命令
###### 启动命令
```
python manage.py runserver --host 0.0.0.0
```
###### 测试命令
```
python manage.py test
```
###### 覆盖报告
```
python manage.py test --coverage
```
---
### 数据库迁移
###### 初始化
```
python manage.py db init
```
###### 生成脚本
```
python manage.py db migrate -m "initial migration"
```
###### 更新数据库
```
python manage.py db upgrade
```
对第一个迁移来说, 其作用和调用db.create_all() 方法一样。但在后续的迁移中,
upgrade 命令能把改动应用到数据库中,且不影响其中保存的数据。
###### 代码性能分析
```
python manage.py profile 启动,浏览器请求
```
###### 服务器启动命令
```
gunicorn -b 0.0.0.0:8000 manage:app
```
UI框架
DOC http://spin.webkom.co/docs/docs.html
#### 打包
```
python setup.py sdist
twine upload dist/pyfw-1.0.6.tar.gz
```
#### 使用pip生成依赖文件:
```
pip freeze >requirements.txt
```
安装或升级包后,最好更新这个文件。
#### 根据依赖文件安装包:
```
pip install -r requirements.txt
```
### 移除所有包
```
pip freeze | xargs pip uninstall -y
```
###### 启动命令
```
python manage.py runserver --host 0.0.0.0
```
###### 测试命令
```
python manage.py test
```
###### 覆盖报告
```
python manage.py test --coverage
```
---
### 数据库迁移
###### 初始化
```
python manage.py db init
```
###### 生成脚本
```
python manage.py db migrate -m "initial migration"
```
###### 更新数据库
```
python manage.py db upgrade
```
对第一个迁移来说, 其作用和调用db.create_all() 方法一样。但在后续的迁移中,
upgrade 命令能把改动应用到数据库中,且不影响其中保存的数据。
###### 代码性能分析
```
python manage.py profile 启动,浏览器请求
```
###### 服务器启动命令
```
gunicorn -b 0.0.0.0:8000 manage:app
```
UI框架
DOC http://spin.webkom.co/docs/docs.html
#### 打包
```
python setup.py sdist
twine upload dist/pyfw-1.0.6.tar.gz
```
#### 使用pip生成依赖文件:
```
pip freeze >requirements.txt
```
安装或升级包后,最好更新这个文件。
#### 根据依赖文件安装包:
```
pip install -r requirements.txt
```
### 移除所有包
```
pip freeze | xargs pip uninstall -y
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyfw-1.0.11.tar.gz
(9.7 kB
view hashes)
Built Distribution
pyfw-1.0.11-py2.py3-none-any.whl
(15.0 kB
view hashes)
Close
Hashes for pyfw-1.0.11-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14bb3893987e4130959957415377ced5b2815465a87cb1c584b2b436044ad038 |
|
MD5 | 7b3e0029f265958e5023566d7c307e70 |
|
BLAKE2b-256 | 4caa513c21e5224d602c480fa5b67aa18ab56188768010dab3f3041d711f424b |