代码拉取完成,页面将自动刷新
同步操作将从 秋枫zsp/rocket 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import os
class Config(object):
MYSQL_HOST = "127.0.0.1"
MYSQL_USER = "root"
MYSQL_PWD = "123456"
MYSQL_PORT = 3306
DBNAME = "rocket"
SQLALCHEMY_DATABASE_URI = f"mysql+pymysql://{MYSQL_USER}:{MYSQL_PWD}@{MYSQL_HOST}:{MYSQL_PORT}/{DBNAME}"
SQLALCHEMY_TRACK_MODIFICATIONS = False
# token加密key和过期时间
TOKEN_KEY = "rocket"
TOKEN_EXPIRATION = 336
EXECUTOR_THREAD_POOL = 2
class FilePath(object):
ROOT_PATH = os.path.dirname(os.path.abspath(__file__)) # ROOT_PATH
APP_PATH = os.path.join(ROOT_PATH, "app") # app 路径
LOG_FILE_PATH = os.path.join(ROOT_PATH, "logs") # 日志文件路径
if not os.path.isdir(LOG_FILE_PATH):
os.mkdir(LOG_FILE_PATH)
FILE_PATH = os.path.join(ROOT_PATH, "files") # 文件路径
if not os.path.isdir(FILE_PATH):
os.mkdir(FILE_PATH)
ROCKET_SERVER = os.path.join(LOG_FILE_PATH, "rocket_server.log")
# ROCKET_HTTP = os.path.join(LOG_FILE_PATH, "rocket_http.log")
ROCKET_ERROR = os.path.join(LOG_FILE_PATH, "rocket_error.log")
# 项目日志滚动配置(日志文件超过10 MB就自动新建文件扩充)
LOGGING_ROTATION = "10 MB"
# 项目日志配置
LOGGING_CONF = {
"server_handler": {
"file": FilePath.ROCKET_SERVER,
"level": "INFO",
"rotation": LOGGING_ROTATION,
"enqueue": True,
"backtrace": False,
"diagnose": False,
},
"error_handler": {
"file": FilePath.ROCKET_ERROR,
"level": "ERROR",
"rotation": LOGGING_ROTATION,
"enqueue": True,
"backtrace": True,
"diagnose": True,
}
}
ROCKET_ENV = os.environ.get("rocket_env", "dev")
BANNER = """
______ _____ _____ _ __ _____ _____
| ___ \| _ |/ __ \| | / /| ___||_ _|
| |_/ /| | | || / \/| |/ / | |__ | |
| / | | | || | | \ | __| | |
| |\ \ \ \_/ /| \__/\| |\ \| |___ | |
\_| \_| \___/ \____/\_| \_/\____/ \_/
"""
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。