From 44d8561ed002b3949f3fa8d77ced41e347ab8add Mon Sep 17 00:00:00 2001 From: zhangwenwen Date: Tue, 10 Aug 2021 10:13:50 +0800 Subject: [PATCH] initialization --- .gitignore | 1 + app/__init__.py | 8 ++++++++ app/main/__init__.py | 3 +++ config.py | 0 manage.py | 13 +++++++++++++ tests/__init__.py | 0 6 files changed, 25 insertions(+) create mode 100644 app/__init__.py create mode 100644 app/main/__init__.py create mode 100644 config.py create mode 100644 manage.py create mode 100644 tests/__init__.py diff --git a/.gitignore b/.gitignore index f8b73e7..f2313e0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.idea # ---> Python # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/app/__init__.py b/app/__init__.py new file mode 100644 index 0000000..c8d1d6a --- /dev/null +++ b/app/__init__.py @@ -0,0 +1,8 @@ +from flask import Flask, render_template +from flask_bootstrap import Bootstrap +from flask_moment import Moment + + +def create_app(config_name): + app = Flask(__name__) + return app diff --git a/app/main/__init__.py b/app/main/__init__.py new file mode 100644 index 0000000..61a67f3 --- /dev/null +++ b/app/main/__init__.py @@ -0,0 +1,3 @@ +from flask import Blueprint + +main = Blueprint('main', __name__) diff --git a/config.py b/config.py new file mode 100644 index 0000000..e69de29 diff --git a/manage.py b/manage.py new file mode 100644 index 0000000..59d826f --- /dev/null +++ b/manage.py @@ -0,0 +1,13 @@ +import os + +from app import create_app + +from flask_script import Manager,Shell + + +app=create_app(os.getenv('FLASK_CONFIG') or 'default') + +manager=Manager(app) + +if __name__ == '__main__': + manager.run() \ No newline at end of file diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29