学习 Python 的 Web 框架 Falcon
Go to file
BryantHe f9d9c4990b update: readme 2023-07-16 14:38:29 +08:00
app feat: complete image-sharing appWSGI Tutorial 2023-07-14 21:42:29 +08:00
tests feat: complete image-sharing appWSGI Tutorial 2023-07-14 21:42:29 +08:00
.gitignore feat: complete image-sharing appWSGI Tutorial 2023-07-14 21:42:29 +08:00
README.md update: readme 2023-07-16 14:38:29 +08:00
requirements.txt feat: complete image-sharing appWSGI Tutorial 2023-07-14 21:42:29 +08:00

README.md

falcon-wsgi-example

学习 Python 的 Web 框架 Falcon

WSGI 协议

安装依赖

python3 -m pip install -r requirements.txt

WSGI Tutorial

实现了 WSGI Tutorial 的 image-sharing app

提交图片

http POST localhost:8000/images Content-Type:image/png < /Users/apple/IMG_0976_little.png

查询图片

http GET localhost:8000/images/<image_name.xxx>

运行测试

运行单元测试

运行所有测试

coverage run -m pytest tests

运行单个测试

pytest tests -k <test_func_name>

运行功能测试

启动 app

LOOK_STORAGE_PATH=./images gunicorn --reload 'app.app:get_app()'

运行测试

pytest tests -k test_posted_image_gets_saved