{"repo":"yangyuexiong/Flask_BestPractices","free":true,"listed":false,"github":"https://github.com/yangyuexiong/Flask_BestPractices","clone":"git clone https://github.com/yangyuexiong/Flask_BestPractices.git","description":"Flask最佳实践","language":"Python","stars":203,"topics":["flask","python","web-framework","wsgi","werkzeug"],"license":"MPL-2.0","category":"api-integrations-sdks","readme_excerpt":"Flask BestPractices Flask 最佳实践 ---------- 持续更新 - 更新日志 至2026 Flask 已不是 Python 首选的Web框架，但作为学习Python后端开发该项目结构还有一定学习价值以及在小项目中比较受用 这是一个项目结构，可以直接使用并开始编写业务(作为热爱Python开发的你们，希望在熟悉 Flask 开发后，继续学习 Fastapi ) 该项目包含前后端分离 Restful Api 以及 不分离 Jinja2 模版渲染 以下使用此结构结合 Vue 实现一套前后分自动化测试平台 自动化测试平台Web端: https://github.com/ExileLine/ExileTestPlatformWeb 自动化测试平台服务端: https://github.com/ExileLine/ExileTestPlatformServer Fastapi 最佳实践: https://github.com/yangyuexiong/FastApi BestPractices 大佬们！下面简陋的文档凑合先看着，有空闲时间补上详细使用文档 如有疑问 - QQ or Wechat : 417993207 (使用遇到问题请马上联系我会及时为你解答) 你不点 Star 我更新给谁看? Github : https://github.com/yangyuexiong/Flask BestPractices 码云 : https://gitee.com/yangyuexiong/Flask BestPractices Flask 官方文档 https://flask.palletsprojects.com/ Flask 中文文档 https://dormousehole.readthedocs.io/en/latest/ ---------- 感谢支持<<<<<<---------- 一、安装 - Python3.9+ - pip3 - pipenv(在新项目中更推荐使用uv) 二、配置虚拟环境 - 进入项目根目录 - 修改 pipenv 的 pip 安装源(科学上网(翻墙)的同学可以忽略) - Pipfile - 安装虚拟环境与依赖的包 - 进入虚拟环境 - 查看虚拟环境路径 - Pycharm 配置 pipenv 虚拟环境(不使用 Pycharm 的同学可以忽略) - Mac - Windows - 配置 Pycharm 的 Flask 变量(因为 Pycharm 运行项目不会读取系统变量所以要配置在 Pycharm 中) - 配置 Flask 运行变量 - FLASK ENV：Flask运行环境(启动的时候默认 production 为了区分 开发 与 生产 通过以下方式配置，以下配置只能在终端启动项目生效在 Pycharm 不生效) - FLASK DEBUG：Flask2.3之后需要用到，1-True;0-False - FLASK APP：Flask应用实例，用于执行orm迁移，flask cli脚本，异步任务等需要。 - Windows 系统(一般用于开发环境) - FLASK ENV 为 development - FLASK DEBUG 为 1 - FLASK APP 为 ApplicationExample.py - MacOS 系统(一般用于开发环境) - FLASK ENV 为 development - FLASK DEBUG 为 1 - FLASK APP 为 ApplicationExampl","default_branch":null,"files":null,"tree":[],"storefront":"/r/yangyuexiong","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/yangyuexiong/Flask_BestPractices/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}