【python-web】开源个fastapi脚手架

02-27 阅读 0评论

01 说明

对于python-web后端而言,设计一套后端项目结构信手拈来,而对于爬虫工程师来说可能并不是那么的容易。这里在下基于fastapi以及cookiecutter开源了个脚手架,帮助大家伙一键搭建fastapi项目结构。

【python-web】开源个fastapi脚手架,【python-web】开源个fastapi脚手架,词库加载错误:未能找到文件“C:\Users\Administrator\Desktop\火车头9.8破解版\Configuration\Dict_Stopwords.txt”。,地址,功能,名称,第1张
(图片来源网络,侵删)

项目地址https://gitee.com/if-always/cookiecutter-fastapi

【python-web】开源个fastapi脚手架

02 使用 

// python 版本 3.11
pip install cookiecutter
cookiecutter https://gitee.com/if-always/cookiecutter-fastapi

然后根据提示输入项目名称、作者名称即可:

【python-web】开源个fastapi脚手架

 项目结构:

【python-web】开源个fastapi脚手架

【python-web】开源个fastapi脚手架,【python-web】开源个fastapi脚手架,词库加载错误:未能找到文件“C:\Users\Administrator\Desktop\火车头9.8破解版\Configuration\Dict_Stopwords.txt”。,地址,功能,名称,第5张
(图片来源网络,侵删)

【python-web】开源个fastapi脚手架

目录以及文件的功能

api                // 接口函数
component          // 常用组件(mysql、redis......)
core               // fastapi 核心层
log                // 日志
models             // 模板
network            // 网络请求封装
router             // 路由
service            // view层
timer              // 定时器
util               // 工具函数
debug.py           // 本地测试入口
defines.py         // 常量定义
env.py             // 配置文件
main.py            // 线上入口
Dockerfile         // docker
docker-compose.yml // compose 启动

 接着就可以愉快的写业务逻辑了!

【python-web】开源个fastapi脚手架,【python-web】开源个fastapi脚手架,词库加载错误:未能找到文件“C:\Users\Administrator\Desktop\火车头9.8破解版\Configuration\Dict_Stopwords.txt”。,地址,功能,名称,第7张
(图片来源网络,侵删)

免责声明
本网站所收集的部分公开资料来源于AI生成和互联网,转载的目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。
文章版权声明:除非注明,否则均为主机测评原创文章,转载或复制请以超链接形式并注明出处。

发表评论

快捷回复: 表情:
评论列表 (暂无评论,人围观)

还没有评论,来说两句吧...

目录[+]