Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
崔为之
elp
Commits
bfd6c985
Commit
bfd6c985
authored
Nov 04, 2023
by
崔为之
💪🏽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update project
parent
9416fd84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
application/__init__.py
application/__init__.py
+18
-4
No files found.
application/__init__.py
View file @
bfd6c985
...
...
@@ -20,15 +20,29 @@ from application.script import init_script
def
create_app
()
->
Flask
:
app
=
Flask
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"."
)))
"""
This function creates and initializes a new Flask application.
# 注册各种插件
:return: A new instance of a Flask application.
"""
# Determine the path of the application root directory
app_root_path
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"."
))
# Create a new Flask application instance
app
=
Flask
(
app_root_path
)
# Initialize various plugins for the application.
# This could include things like database connectors, authentication systems, etc.
init_plugs
(
app
)
# 注册路由
# Register the routes that this application will respond to.
# This includes both the route URLs and the handlers for each route.
init_views
(
app
)
# 注册命令
# Register any scripts or commands that can be run from the command line.
# This could include data migration scripts, administrative tasks, etc.
init_script
(
app
)
# Return the fully initialized Flask application
return
app
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment