Skip to main content
### 基础开发命令



###### 启动命令
```
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



#### 打包
```
python3 setup.py sdist bdist_wheel

twine upload dist/*
```



#### 使用pip生成依赖文件:


```
pip freeze >requirements.txt
```



安装或升级包后,最好更新这个文件。

#### 根据依赖文件安装包:


```
pip install -r requirements.txt
```

### 移除所有包
```
pip freeze | xargs pip uninstall -y
```

Metadata

Release files for pyfw 1.0.26

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyfw 1.0.26
File Size Uploaded
pyfw-1.0.26.tar.gz 11.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyfw 1.0.26
File Interpreter ABI Platform
pyfw-1.0.26-py3-none-any.whl Python 3 none any Details

Total release size: 31.1 kB

Release files / pyfw-1.0.26.tar.gz

Download URL pyfw-1.0.26.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
54afbf0f5b4bacfc112e5e62c39ac79a1656847c16c059323dd389145c9d0b7c
BLAKE2b-256 checksum
How to use checksums
172f081b5851ac22cfb2b55117d137cdbf4f7805606ff54d893a5ea965eb1adf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.2

Release files / pyfw-1.0.26-py3-none-any.whl

Download URL pyfw-1.0.26-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20a05673bfae861e686288318f72a85263a9e690a3939b1a2919a50bad35eb31
BLAKE2b-256 checksum
How to use checksums
7838a6474dc3f0e969627505970884cb9fcc33cb03865add9bbcb1d660cd865d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.2
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page