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
d733b070
Commit
d733b070
authored
Nov 11, 2023
by
崔为之
💪🏽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update project
parent
2f6009fa
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
9 deletions
+10
-9
application/__init__.py
application/__init__.py
+3
-2
application/common/__init__.py
application/common/__init__.py
+1
-1
application/common/universal.py
application/common/universal.py
+5
-5
application/libs/helper/config.py
application/libs/helper/config.py
+1
-1
No files found.
application/__init__.py
View file @
d733b070
...
...
@@ -18,7 +18,7 @@ from application.extensions import init_plugs
from
application.views
import
init_views
from
application.script
import
init_script
from
application.utils
import
make_celery
from
application.common
import
config
from
application.common
import
global_config
as
gc
def
create_app
()
->
Flask
:
...
...
@@ -39,7 +39,8 @@ def create_app() -> Flask:
init_plugs
(
app
)
# Set universal config
config
.
universal
=
app
.
config
# 将 app.config 的内容复制到全局对象
gc
.
config
=
app
.
config
.
copy
()
# Register the routes that this application will respond to.
# This includes both the route URLs and the handlers for each route.
...
...
application/common/__init__.py
View file @
d733b070
...
...
@@ -10,4 +10,4 @@
# @Description :
"""
from
.
config
import
C
onfig
from
.
universal
import
global_c
onfig
application/common/
config
.py
→
application/common/
universal
.py
View file @
d733b070
...
...
@@ -6,17 +6,17 @@
# @Author : StudentCWZ
# @Email : StudentCWZ@outlook.com
# @Date : 2023/11/11 14:11
# @File :
config
.py
# @File :
universal
.py
# @Description :
"""
#
config
.py
class
Config
:
#
universal
.py
class
Global
Config
:
"""Configuration for the application."""
def
__init__
(
self
):
self
.
universal
=
None
self
.
config
=
{}
# This creates a global instance of the Config class
config
=
Config
()
global_config
=
Global
Config
()
application/libs/helper/config.py
View file @
d733b070
...
...
@@ -6,7 +6,7 @@
# @Author : StudentCWZ
# @Email : StudentCWZ@outlook.com
# @Date : 2023/11/3 19:43
# @File :
config
.py
# @File :
universal
.py
# @Description :
"""
...
...
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