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
af484b68
Commit
af484b68
authored
Nov 12, 2023
by
崔为之
💪🏽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update project
parent
1c14fa79
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
42 deletions
+0
-42
application/__init__.py
application/__init__.py
+0
-5
application/common/__init__.py
application/common/__init__.py
+0
-13
application/common/universal.py
application/common/universal.py
+0
-22
application/libs/tasks/task.py
application/libs/tasks/task.py
+0
-2
No files found.
application/__init__.py
View file @
af484b68
...
@@ -17,7 +17,6 @@ from flask import Flask
...
@@ -17,7 +17,6 @@ from flask import Flask
from
application.extensions
import
init_plugs
from
application.extensions
import
init_plugs
from
application.views
import
init_views
from
application.views
import
init_views
from
application.script
import
init_script
from
application.script
import
init_script
from
application.common
import
global_config
as
gc
def
create_app
()
->
Flask
:
def
create_app
()
->
Flask
:
...
@@ -37,10 +36,6 @@ def create_app() -> Flask:
...
@@ -37,10 +36,6 @@ def create_app() -> Flask:
# This could include things like database connectors, authentication systems, etc.
# This could include things like database connectors, authentication systems, etc.
init_plugs
(
app
)
init_plugs
(
app
)
# Set universal config
# 将 app.config 的内容复制到全局对象
gc
.
config
=
app
.
config
.
copy
()
# Register the routes that this application will respond to.
# Register the routes that this application will respond to.
# This includes both the route URLs and the handlers for each route.
# This includes both the route URLs and the handlers for each route.
init_views
(
app
)
init_views
(
app
)
...
...
application/common/__init__.py
deleted
100644 → 0
View file @
1c14fa79
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# @Version : Python 3.11.4
# @Software : Sublime Text 4
# @Author : StudentCWZ
# @Email : StudentCWZ@outlook.com
# @Date : 2023/11/3 19:42
# @File : __init__.py
# @Description :
"""
from
.universal
import
global_config
application/common/universal.py
deleted
100644 → 0
View file @
1c14fa79
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# @Version : Python 3.11.4
# @Software : Sublime Text 4
# @Author : StudentCWZ
# @Email : StudentCWZ@outlook.com
# @Date : 2023/11/11 14:11
# @File : universal.py
# @Description :
"""
# universal.py
class
GlobalConfig
:
"""Configuration for the application."""
def
__init__
(
self
):
self
.
config
=
{}
# This creates a global instance of the Config class
global_config
=
GlobalConfig
()
application/libs/tasks/task.py
View file @
af484b68
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
import
datetime
import
datetime
from
application.extensions.init_sqlalchemy
import
db
from
application.extensions.init_sqlalchemy
import
db
from
application.models
import
User
from
application.models
import
User
from
application.common
import
global_config
from
application.libs.helper
import
MySQLHelper
from
application.libs.helper
import
MySQLHelper
...
@@ -38,6 +37,5 @@ def task():
...
@@ -38,6 +37,5 @@ def task():
# user = User(username="CWzz", email="Stuu@outlook.com", password="qwe!2345", active=True,
# user = User(username="CWzz", email="Stuu@outlook.com", password="qwe!2345", active=True,
# created_at=datetime.datetime.utcnow())
# created_at=datetime.datetime.utcnow())
# user.save()
# user.save()
print
(
db
.
app
.
config
)
print
(
"created user admin"
)
print
(
"created user admin"
)
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