{"id":21557129,"url":"https://github.com/shenfe/flask-fast","last_synced_at":"2026-04-21T16:32:56.498Z","repository":{"id":143949409,"uuid":"136645222","full_name":"shenfe/flask-fast","owner":"shenfe","description":"A boilerplate for Flask Web projects.","archived":false,"fork":false,"pushed_at":"2018-07-16T03:43:20.000Z","size":92,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-18T03:28:37.779Z","etag":null,"topics":["flask","python","rest-api","swagger"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shenfe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-08T16:58:28.000Z","updated_at":"2018-07-16T03:43:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"61c69672-583b-4e56-8372-c2e72c4bce0b","html_url":"https://github.com/shenfe/flask-fast","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shenfe/flask-fast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shenfe%2Fflask-fast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shenfe%2Fflask-fast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shenfe%2Fflask-fast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shenfe%2Fflask-fast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shenfe","download_url":"https://codeload.github.com/shenfe/flask-fast/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shenfe%2Fflask-fast/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262614456,"owners_count":23337277,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","python","rest-api","swagger"],"created_at":"2024-11-24T08:11:06.318Z","updated_at":"2026-04-21T16:32:51.471Z","avatar_url":"https://github.com/shenfe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flask-Fast\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./doc/logo-python.png\"\u003e\n\u003cimg src=\"./doc/logo-flask.png\"\u003e\n\u003c/p\u003e\n\n## 模板项目特性\n\n* 将Flask应用最小化、模块化，并实现前后端分离\n* 使用[Flask-RestPlus](http://flask-restplus.readthedocs.io)实现RESTful API\n    * 结合[Swagger](http://flask-restplus.readthedocs.io/en/stable/swagger.html)将**接口自动文档化**\n* 使用[PyTest](http://pytest.org)进行接口测试和代码覆盖率测试\n\n## 模板项目结构\n\n模板项目使用Flask \u0026 Flask-RestPlus构建RESTful API。\n\n### Blueprints\n\n整个应用主要使用两个blueprint：\n\n* Api Blueprint\n\n    使用Flask-RestPlus或普通的app.route来serve资源，在`/api`端点。\n\n* Client Blueprint\n\n    Flask仅仅serve Web应用的入口点，在`/`根路径端点。\n\n## 安装\n\n#### 环境\n\n* Python 2.7+或3.x\n\n#### 模板和依赖\n\n* Clone仓库\n\n* 创建一个[virtual enviroment](https://packaging.python.org/tutorials/managing-dependencies/#managing-dependencies)（推荐）\n\n    ```sh\n    $ pip install --user pipenv\n    ```\n\n* 安装Python依赖，建议使用**pipenv**命令（在项目根目录下）\n\n    ```sh\n    $ pipenv install\n    ```\n\n## 服务\n\n### 开发服务器（Development Server）\n\n使用Flask serve所有API端点。服务器能在文件改动保存时自动重载。\n\n项目根目录，执行\n\n```sh\n$ python run.py\n```\n\n或执行\n\n```sh\n$ sh ./run.sh -d\n```\n\n这会在`localhost:5000`启动Flask开发服务器，并在`/api`端点响应接口请求。\n\n### 生产环境服务器（Production Server）\n\n项目根目录，执行以下步骤。\n\n* 设置环境变量：\n\n    执行\n\n    ```sh\n    $ export FLASK_CONFIG=\"Production\"\n    ```\n\n* 运行Flask应用：\n\n    执行\n\n    ```sh\n    $ python run.py\n    ```\n\n    或执行\n\n    ```sh\n    $ sh ./run.sh\n    ```\n\n    或使用Gunicorn运行应用（注意端口变化）：\n\n    ```sh\n    $ gunicorn app:app\n    ```\n\n## 开发\n\n### 接口\n\n#### 接口定义\n\n普通接口：[`app/api/normal.py`](./app/api/normal.py)\n\nRESTful接口：[`app/api/rest`](./app/api/rest/res_sample.py)\n\nRESTful接口**自动文档化**，在API路径下的`doc`路径，如http://localhost:5000/api/doc/。\n\n#### 接口测试\n\n编写pytest测试集：[test](./test)（另见“测试”）\n\n推荐使用[PostMan](https://www.getpostman.com/)进行API开发和测试。\n\n#### 接口Mock\n\n假数据：`app/client/mock`。\n\n## 测试\n\n确保dev依赖：\n\n```sh\n$ pipenv install --dev\n```\n\n运行pytest：\n\n```sh\n$ pipenv run pytest\n```\n\n## Todo\n\n* [x] [Flask-CAS](https://github.com/cameronbwhite/Flask-CAS)\n* [x] [Flask-CORS](https://github.com/corydolphin/flask-cors)\n* [ ] Celery\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshenfe%2Fflask-fast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshenfe%2Fflask-fast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshenfe%2Fflask-fast/lists"}