From 77745e6f01dc5b62b33dbe0314497d977b13f82e Mon Sep 17 00:00:00 2001 From: MarkusJoe Date: Sat, 2 Apr 2022 18:03:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=80=E4=BA=9B=E7=BB=86?= =?UTF-8?q?=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/__init__.py | 10 ++++++-- app/db/__init__.py | 3 +++ app/main/errors.py | 1 - app/templates/index.html | 55 ++++++++++++++++++++-------------------- app/tests/__init__.py | 3 +++ manage.py | 3 ++- 6 files changed, 44 insertions(+), 31 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index fc1d98c..e594b64 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -15,8 +15,6 @@ from .main import main class Config: JSON_SORT_KEYS = False JSON_AS_ASCII = False - SQLALCHEMY_DATABASE_URI = './app/db/data.db' - SQLALCHEMY_TRACK_MODIFICATIONS = False @staticmethod def init_app(app): @@ -61,3 +59,11 @@ if __name__ == '__main__': print('数据库文件未找到, 正在下载中') download() print('下载完成') + +__all__ = [ + 'db', + 'main', + 'tests', + 'utils', + 'create_app' +] diff --git a/app/db/__init__.py b/app/db/__init__.py index 5f1ffbf..3c26b3f 100644 --- a/app/db/__init__.py +++ b/app/db/__init__.py @@ -4,3 +4,6 @@ # @Development Tool: PyCharm # @Create Time: 2022/3/25 # @File Name: __init__.py.py + + +__all__ = ['db'] diff --git a/app/main/errors.py b/app/main/errors.py index aefa404..736b4f9 100644 --- a/app/main/errors.py +++ b/app/main/errors.py @@ -26,4 +26,3 @@ def internal_server_error(e): :return: """ return {'code': 500, 'msg': '服务器内部错误', 'data': []}, 500 - diff --git a/app/templates/index.html b/app/templates/index.html index b38d953..b20a952 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -2,11 +2,8 @@ - Request Counter - Index - - - + Request Counter | {{ remote_address }} +