合并配置文件,解决logo打印多次问题
This commit is contained in:
@@ -5,6 +5,9 @@ FLASK_DEBUG=1
|
||||
FLASK_RUN_HOST = 127.0.0.1
|
||||
FLASK_RUN_PORT = 5000
|
||||
|
||||
# pear admin flask配置
|
||||
SYSTEM_NAME = Pear Admin
|
||||
|
||||
# MySql配置信息
|
||||
MYSQL_HOST=127.0.0.1
|
||||
# MYSQL_HOST=dbserver
|
||||
|
||||
@@ -2,7 +2,6 @@ import os
|
||||
from flask import Flask
|
||||
|
||||
from applications.common.script import init_script
|
||||
from applications.configs import common
|
||||
from applications.extensions import init_plugs
|
||||
from applications.view import init_view
|
||||
from applications.configs import config
|
||||
@@ -16,7 +15,6 @@ def create_app(config_name=None):
|
||||
config_name = os.getenv('FLASK_CONFIG', 'development')
|
||||
|
||||
# 引入数据库配置
|
||||
app.config.from_object(common)
|
||||
app.config.from_object(config[config_name])
|
||||
|
||||
# 注册各种插件
|
||||
@@ -28,6 +26,7 @@ def create_app(config_name=None):
|
||||
# 注册命令
|
||||
init_script(app)
|
||||
|
||||
if os.environ.get('WERKZEUG_RUN_MAIN') == 'true':
|
||||
logo()
|
||||
|
||||
return app
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
SYSTEM_NAME = "Pear Admin"
|
||||
# 主题面板的链接列表配置
|
||||
SYSTEM_PANEL_LINKS = [
|
||||
{
|
||||
"icon": "layui-icon layui-icon-auz",
|
||||
"title": "官方网站",
|
||||
"href": "http://www.pearadmin.com"
|
||||
},
|
||||
{
|
||||
"icon": "layui-icon layui-icon-auz",
|
||||
"title": "开发文档",
|
||||
"href": "http://www.pearadmin.com"
|
||||
},
|
||||
{
|
||||
"icon": "layui-icon layui-icon-auz",
|
||||
"title": "开源地址",
|
||||
"href": "https://gitee.com/Jmysy/Pear-Admin-Layui"
|
||||
}
|
||||
]
|
||||
|
||||
UPLOADED_PHOTOS_DEST = 'static/upload'
|
||||
UPLOADED_FILES_ALLOW = ['gif', 'jpg']
|
||||
# JSON配置
|
||||
JSON_AS_ASCII = False
|
||||
@@ -3,6 +3,33 @@ import os
|
||||
|
||||
|
||||
class BaseConfig:
|
||||
|
||||
SYSTEM_NAME = os.getenv('SYSTEM_NAME', 'Pear Admin')
|
||||
# 主题面板的链接列表配置
|
||||
SYSTEM_PANEL_LINKS = [
|
||||
{
|
||||
"icon": "layui-icon layui-icon-auz",
|
||||
"title": "官方网站",
|
||||
"href": "http://www.pearadmin.com"
|
||||
},
|
||||
{
|
||||
"icon": "layui-icon layui-icon-auz",
|
||||
"title": "开发文档",
|
||||
"href": "http://www.pearadmin.com"
|
||||
},
|
||||
{
|
||||
"icon": "layui-icon layui-icon-auz",
|
||||
"title": "开源地址",
|
||||
"href": "https://gitee.com/Jmysy/Pear-Admin-Layui"
|
||||
}
|
||||
]
|
||||
|
||||
UPLOADED_PHOTOS_DEST = 'static/upload'
|
||||
UPLOADED_FILES_ALLOW = ['gif', 'jpg']
|
||||
|
||||
# JSON配置
|
||||
JSON_AS_ASCII = False
|
||||
|
||||
SECRET_KEY = os.getenv('SECRET_KEY', 'dev key')
|
||||
|
||||
# redis配置
|
||||
@@ -16,7 +43,6 @@ class BaseConfig:
|
||||
MYSQL_PORT = int(os.getenv('MYSQL_PORT') or 3306)
|
||||
MYSQL_DATABASE = os.getenv('MYSQL_DATABASE') or "PearAdminFlask"
|
||||
|
||||
|
||||
# mysql 数据库的配置信息
|
||||
SQLALCHEMY_DATABASE_URI = f"mysql+pymysql://{MYSQL_USERNAME}:{MYSQL_PASSWORD}@{MYSQL_HOST}:{MYSQL_PORT}/{MYSQL_DATABASE}"
|
||||
# 默认日志等级
|
||||
|
||||
Reference in New Issue
Block a user