From 133a8cb24de8d45420483585b2c36b7f66f1a84b Mon Sep 17 00:00:00 2001 From: MarkusJoe Date: Sat, 26 Feb 2022 14:12:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E5=9C=A8=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E5=8F=AF=E4=BB=A5=E4=BD=BF=E7=94=A8=E4=BD=86=E6=98=AF?= =?UTF-8?q?=E5=9C=A8heroku=E9=83=A8=E7=BD=B2=E5=90=8E=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 3 ++- bin/db/db.py | 6 ------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/app.py b/app.py index ef48b44..c20a0f8 100644 --- a/app.py +++ b/app.py @@ -27,6 +27,8 @@ app = Flask(__name__, static_url_path='') app.config['JSON_SORT_KEYS'] = False # 设置JSON消息不根据字母顺序重新排序 app.config['JSON_AS_ASCII'] = False # 设置JSON消息显示中文 +conf = Settings() + def build_page(name: str, length: int, theme: str) -> list[bool or Response] or list[bool or Any] or list[bool or str]: """ @@ -174,7 +176,6 @@ def index() -> Response: if __name__ == '__main__': - conf = Settings() logger.info(f'服务器已在 http://127.0.0.1:{conf.port} 运行') try: server = pywsgi.WSGIServer((conf.host, conf.port), app, log=None) # log=None 关闭日志输出, 使用自写的日志器记录 diff --git a/bin/db/db.py b/bin/db/db.py index bc92a26..eb64b40 100644 --- a/bin/db/db.py +++ b/bin/db/db.py @@ -120,9 +120,3 @@ class SQLite: conn.close() -if __name__ == '__main__': - print('MySQL数据库并未开发完成暂时只能使用SQLite数据库\n' - '如果你想帮助开发MySQL的支持你可以在./bin/tests内找到MySQL_.py并继续开发\n' - '开发进度: 已经完成 删, 改, 增, 查, 以及查询已有的表\n' - '获取配置文件直接使用from bin.utils.settings import Settings\n' - '可以直接实例化并使用此类, 调用Settings内的属性可以直接获取对应的信息')