__init__.py 432 字节
Newer Older
梦想橡皮擦's avatar
梦想橡皮擦 已提交
1
from flask import Flask
梦想橡皮擦's avatar
梦想橡皮擦 已提交
2 3 4
from flask_sqlalchemy import SQLAlchemy

from .config import BaseConfig # 导入配置文件
梦想橡皮擦's avatar
梦想橡皮擦 已提交
5 6 7

app = Flask(__name__)

梦想橡皮擦's avatar
梦想橡皮擦 已提交
8 9 10 11 12 13 14
app.config.from_object(BaseConfig) # 启用配置

db = SQLAlchemy()
db.init_app(app) # 初始化数据库


# 导入路由配置
梦想橡皮擦's avatar
梦想橡皮擦 已提交
15
from app import routes
梦想橡皮擦's avatar
梦想橡皮擦 已提交
16 17
from app import general
from .school.index import *
梦想橡皮擦's avatar
梦想橡皮擦 已提交
18
from .file.index import *
梦想橡皮擦's avatar
梦想橡皮擦 已提交
19 20

app.register_blueprint(s)
梦想橡皮擦's avatar
梦想橡皮擦 已提交
21
app.register_blueprint(f)
梦想橡皮擦's avatar
梦想橡皮擦 已提交
22 23 24 25 26 27 28