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

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

app = Flask(__name__)

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

db = SQLAlchemy()
梦想橡皮擦's avatar
梦想橡皮擦 已提交
11
db.init_app(app)  # 初始化数据库
梦想橡皮擦's avatar
梦想橡皮擦 已提交
12 13

# 导入路由配置
梦想橡皮擦's avatar
梦想橡皮擦 已提交
14
from app import routes
梦想橡皮擦's avatar
梦想橡皮擦 已提交
15 16
from app import general
from .school.index import *
梦想橡皮擦's avatar
梦想橡皮擦 已提交
17
from .file.index import *
梦想橡皮擦's avatar
梦想橡皮擦 已提交
18
from .antispider.index import *
梦想橡皮擦's avatar
梦想橡皮擦 已提交
19
from .csdn.index import *
梦想橡皮擦's avatar
梦想橡皮擦 已提交
20
from .slow.index import *
梦想橡皮擦's avatar
梦想橡皮擦 已提交
21
app.register_blueprint(s)
梦想橡皮擦's avatar
梦想橡皮擦 已提交
22
app.register_blueprint(f)
梦想橡皮擦's avatar
梦想橡皮擦 已提交
23
app.register_blueprint(antispider)
梦想橡皮擦's avatar
梦想橡皮擦 已提交
24 25
app.register_blueprint(cs)
app.register_blueprint(slow)