在启动应用时,初始化数据库
This commit is contained in:
parent
5630696337
commit
2260e52abc
|
@ -6,11 +6,15 @@ from common.exception import NotFoundUserException
|
|||
from config.access_factory import AccessFactory
|
||||
from common.utilities.util_logger import Log
|
||||
import sys
|
||||
from database.sql_db.conn import initialize_database
|
||||
|
||||
# 检查Python运行版本
|
||||
if sys.version_info < (3, 9):
|
||||
raise Exception("Python version must above 3.9 !!")
|
||||
|
||||
# 初始化数据库
|
||||
initialize_database()
|
||||
|
||||
logger = Log.get_logger(__name__)
|
||||
# 启动检查权限
|
||||
AccessFactory.check_access_meta()
|
||||
|
|
|
@ -86,9 +86,6 @@ def initialize_database():
|
|||
SysUserRole.create(user_name='admin', role_name='admin')
|
||||
|
||||
|
||||
initialize_database()
|
||||
|
||||
|
||||
# 自动管理数据库上下文
|
||||
@server.before_request
|
||||
def _db_connect():
|
||||
|
|
Loading…
Reference in New Issue