You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
417 B
22 lines
417 B
|
4 years ago
|
"""
|
||
|
|
@Project :KuajBang
|
||
|
|
@File :init.py
|
||
|
|
@Author :AiNiSuBing
|
||
|
|
@Date :2022/5/6 15:05
|
||
|
|
"""
|
||
|
|
from config import config
|
||
|
|
from flask_sqlalchemy import SQLAlchemy
|
||
|
|
from flask import Flask, render_template
|
||
|
|
|
||
|
|
db = SQLAlchemy()
|
||
|
|
|
||
|
|
|
||
|
|
def create_app(config_name):
|
||
|
|
global app
|
||
|
|
app = Flask(app)
|
||
|
|
app.config.from_object(config[config_name])
|
||
|
|
config[config_name].init_app(app)
|
||
|
|
db.init_app(app)
|
||
|
|
|
||
|
|
return app
|