1 changed files with 21 additions and 0 deletions
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
""" |
||||
@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 |
||||
Loading…
Reference in new issue