Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects, and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Developer articles
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
php-chen
LocalAI-Studio--cloud-sever-clint-python
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
LocalAI-Studio--cloud-sever-clint-python
/
run_app.py
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
55 lines (38 loc) · 1.99 KB
main
Breadcrumbs
LocalAI-Studio--cloud-sever-clint-python
/
run_app.py
Copy path
Top
File metadata and controls
Code
Blame
55 lines (38 loc) · 1.99 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
"""
================================================================================
文件信息:run_app.py
================================================================================
【AI 修改本文件时必须遵守的6条规则】
规则1:每当有AI修改本文件时,先找到跟本文件有关联性的文件。
→ 本文件关联 app/__init__.py 中的 create_app() 函数
规则2:简要说明该文件的具体内容与作用,该说明内容要优先符合AI的理解。
→ 本文件是应用入口文件,用于启动 Flask 开发服务器(跨平台版本)
→ 使用绝对导入确保在不同环境下都能正确导入
→ 添加项目根目录到 sys.path
规则3:当本文件发生改变时,要在改变处添加备注与说明,方便后续AI接管本文件时能够快速理解。
规则4:每当本文件因AI发生变动时,AI都需要去访问其他受关联的文件,检查是否需要同步调整。
规则5:在文件开头添加注释,说明本文件与哪些文件有关联,关联信息要优先符合AI的理解。
规则6:每当AI修改本文件以后,如果开发者再进行调整与修改,AI不能删除开发者的修改内容。
【本文件核心作用】
应用入口文件(跨平台版本)。
- 使用 sys.path.insert(0, os.path.abspath('.')) 添加项目根目录
- 确保跨平台环境下导入正确
- 在 debug=True 模式下运行,监听 0.0.0.0:30010
【使用方式】
python run_app.py
【关联文件】
- app/__init__.py:create_app() 函数来源
【开发者修改记录区】
(AI 不得删除或覆盖开发者的修改内容)
================================================================================
"""
#!/usr/bin/env python3
# 使用绝对导入
import sys
import os
# 添加项目根目录到Python路径
sys.path.insert(0, os.path.abspath('.'))
from app import create_app
if __name__ == '__main__':
app = create_app()
app.run(debug=True, host='0.0.0.0', port=30010)
You can’t perform that action at this time.