__init__.py 684 Bytes
Newer Older
Weizhi Cui's avatar
Weizhi Cui committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# @Version     : Python 3.11.4
# @Software    : Sublime Text 4
# @Author      : StudentCWZ
# @Email       : StudentCWZ@outlook.com
# @Date        : 2023/10/28 12:11
# @File        : __init__.py
# @Description :
"""

import os

from flask import Flask

from application.extensions import init_plugs
from application.views import init_views
from application.script import init_script


def create_app() -> Flask:
    app = Flask(os.path.abspath(os.path.join(os.path.dirname(__file__), ".")))

    # 注册各种插件
    init_plugs(app)

    # 注册路由
    init_views(app)

    # 注册命令
    init_script(app)

    return app