优化代码

This commit is contained in:
qiangyanwen 2022-05-29 11:14:19 +08:00
parent e9500c893b
commit f7350f7226
3 changed files with 24 additions and 4 deletions

View File

@ -52,7 +52,7 @@ version_path_separator = os # Use os.pathsep. Default configuration used for ne
# are written from script.py.mako
# output_encoding = utf-8
sqlalchemy.url = driver://user:pass@localhost/dbname
sqlalchemy.url = mysql+pymysql://root:123456@47.96.135.132:3306/monitoring
[post_write_hooks]

View File

@ -1,10 +1,12 @@
import os
import sys
from logging.config import fileConfig
from config.database import DatabaseModel
from sqlalchemy import engine_from_config
from sqlalchemy import pool
from alembic import context
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
@ -18,7 +20,7 @@ if config.config_file_name is not None:
# for 'autogenerate' support
# from myapp import mymodel
# target_metadata = mymodel.Base.metadata
target_metadata = None
target_metadata = DatabaseModel.metadata
# other values from the config, defined by the needs of env.py,
# can be acquired:

View File

@ -300,3 +300,21 @@
2022-05-29 09:52:07 | MainThread:8661964288 | create_app:app:37 - INFO - Server address http://192.168.1.107:8000
2022-05-29 09:52:07 | MainThread:8661964288 | create_app:app:38 - INFO - Api doc address http://192.168.1.107:8000/docs
2022-05-29 09:52:07 | MainThread:8661964288 | create_app:app:39 - INFO - Api redoc address http://192.168.1.107:8000/redoc
2022-05-29 11:13:54 | MainThread:8595076608 | <module>:__init__:16 - INFO - start the automation service development environment
2022-05-29 11:13:54 | MainThread:8595076608 | <module>:__init__:22 - INFO - loading environment configuration file
2022-05-29 11:13:54 | MainThread:8595076608 | create_app:app:15 - INFO - loading application configuration
2022-05-29 11:13:54 | MainThread:8595076608 | create_app:app:16 - INFO - create FastApi app object
2022-05-29 11:13:54 | MainThread:8595076608 | create_app:app:25 - INFO - Adding a New route success
2022-05-29 11:13:54 | MainThread:8595076608 | create_app:app:26 - INFO - Start registering middleware
2022-05-29 11:13:54 | MainThread:8595076608 | create_app:app:36 - INFO - Application started successfully:CORSMiddleware
2022-05-29 11:13:54 | MainThread:8595076608 | create_app:app:37 - INFO - Server address http://192.168.1.107:8000
2022-05-29 11:13:54 | MainThread:8595076608 | create_app:app:38 - INFO - Api doc address http://192.168.1.107:8000/docs
2022-05-29 11:13:54 | MainThread:8595076608 | create_app:app:39 - INFO - Api redoc address http://192.168.1.107:8000/redoc
2022-05-29 11:13:54 | MainThread:8595076608 | create_app:app:15 - INFO - loading application configuration
2022-05-29 11:13:54 | MainThread:8595076608 | create_app:app:16 - INFO - create FastApi app object
2022-05-29 11:13:54 | MainThread:8595076608 | create_app:app:25 - INFO - Adding a New route success
2022-05-29 11:13:54 | MainThread:8595076608 | create_app:app:26 - INFO - Start registering middleware
2022-05-29 11:13:54 | MainThread:8595076608 | create_app:app:36 - INFO - Application started successfully:CORSMiddleware
2022-05-29 11:13:54 | MainThread:8595076608 | create_app:app:37 - INFO - Server address http://192.168.1.107:8000
2022-05-29 11:13:54 | MainThread:8595076608 | create_app:app:38 - INFO - Api doc address http://192.168.1.107:8000/docs
2022-05-29 11:13:54 | MainThread:8595076608 | create_app:app:39 - INFO - Api redoc address http://192.168.1.107:8000/redoc