{"id":29326534,"url":"https://github.com/lavieall/seal-flask","last_synced_at":"2026-05-16T18:34:55.792Z","repository":{"id":105328494,"uuid":"189539501","full_name":"lavieAll/seal-flask","owner":"lavieAll","description":"flask后端服务","archived":false,"fork":false,"pushed_at":"2019-05-31T08:01:25.000Z","size":7817,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-16T05:20:12.344Z","etag":null,"topics":["flask","flask-sqlalchemy","uwsgi"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lavieAll.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-05-31T06:24:27.000Z","updated_at":"2020-07-06T07:01:58.000Z","dependencies_parsed_at":"2023-05-20T16:17:10.407Z","dependency_job_id":null,"html_url":"https://github.com/lavieAll/seal-flask","commit_stats":null,"previous_names":["lavieall/seal-flask"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lavieAll/seal-flask","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lavieAll%2Fseal-flask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lavieAll%2Fseal-flask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lavieAll%2Fseal-flask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lavieAll%2Fseal-flask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lavieAll","download_url":"https://codeload.github.com/lavieAll/seal-flask/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lavieAll%2Fseal-flask/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264138863,"owners_count":23563237,"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","flask-sqlalchemy","uwsgi"],"created_at":"2025-07-07T19:31:57.470Z","updated_at":"2026-05-16T18:34:55.721Z","avatar_url":"https://github.com/lavieAll.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Flask部署\n### 1. 环境\n* OS：CentOS7 x86_64\n* Python: 3.6\n* Flask: 1.0\n* uwsgi: 2.0\n* Nginx或Openresty\n* MySQL: 5.7.26\n### 2. 安装Python36\n```bash\nyum install python36-devel\n```\n### 3. 创建并激活虚拟环境\n```bash\npython3 -m venv venv\n. venv/bin/activate\n```\n### 4. 安装依赖\n```bash\nyum install gcc\n```\n### 5. 安装uwsgi\n```bash\npip install uwsgi\n```\n### 6. 安装nginx或openresty\n```bash\nyum install nginx\nyum install openresty\n```\n### 7. 项目依赖安装\n```bash\npip install -r requirements.txt\n```\n### 8. 在项目目录下添加uwsgi.ini配置\n```ini\n[uwsgi]\n# 套接字通讯端口，相当于为外界留出一个uWSGI服务器的接口，负责与Nginx通信，但注意socket是无法直接通过http请求成功访问\n# 服务器端口\nsocket = 127.0.0.1:5000\n#socket = :5000\n# 浏览器中http访问\n#http = :5000\n# 项目目录\npythonpath = /mnt/data/personal/gcs-flask\n# 指定项目启动脚本名字\nmodule = start\n# 程序内启用的application变量名，一般为app\ncallable = app\n# 处理器个数\nprocesses = 4\n# 线程数\nthreads = 2\n# processes和threads指出了启动uwsgi服务器之后，服务器会打开几个并行的进程，每个进程会开几条线程来等待处理请求，显然这个数字应该合理，太小会使得处理性能不好而太大则会给服务器本身带来太大负担。\n# 获取uwsgi统计信息的服务地址\n#stats = 127.0.0.1:9191\nstats = :9191\n# 使uWSGI进程在后台运行，并将日志打到指定的日志文件或者udp服务器\ndaemonize = ./uwsgi.log\npidfile = ./uwsgi.pid\n```\n### 9. uwsgi启动、停止、重启\n```bash\nuwsgi --ini uwsgi.ini\nuwsgi --stop uwsgi.pid\nuwsgi --reload uwsgi.pid\n```\n\n### 10. nginx配置\n* 创建conf.d文件夹，新建seal.conf文件\n* 在nginx.conf配置添加\ninclude /usr/local/openresty/nginx/conf/conf.d/*.conf;\n```nginx\nupstream flask {\n        server 127.0.0.1:5000;\n}\nserver {\n        listen 9091;\n        charset utf-8;\n        location / {\n            include /usr/local/openresty/nginx/conf/uwsgi_params;\n            uwsgi_pass flask;\n            uwsgi_param UWSGI_PYHOME /mnt/data/personal/gcs-flask/venv;\n            uwsgi_param UWSGI_CHDIR /mnt/data/personal/gcs-flask;\n            uwsgi_param UWSGI_SCRIPT run:start;\n        }\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flavieall%2Fseal-flask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flavieall%2Fseal-flask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flavieall%2Fseal-flask/lists"}