Skip to content

Mr-LiuDC/flask-example-restapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flask-example-restapi

环境准备

创建虚拟环境

# python3.5以上版本
python -m venv /path/to/venv
# 或者用 virtualenv
virtualenv --no-site-packages venv

# 激活虚拟环境
./path/to/venv/Scripts/activate

安装所需依赖

pip install -r requirements.txt
# 或者指定加速源
pip install -r requirements.txt -i https://pypi.douban.com/simple/

导出所有依赖

pip freeze
# 或者输出到文件
pip freeze > requirements.txt

数据准备

初始化数据库

# 数据库初始化
flask db init
# 数据库迁移
flask db migrate
# 或者添加备注信息
flask db migrate -m "Initial migration"
# 数据库升级
flask db upgrade

# 查看版本历史
flask db history
# 数据库降级
flask db downgrade 版本号

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages