from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_session import Session
from config import Config
import redis


# 数据库
db = SQLAlchemy()
redis_store = None


# 通过传入的不同的配置名字，初始化其对应的应用实例
def create_app(config_name):
    # 创建app
    app = Flask(__name__)
    app.config.from_object(config_name)

    # 配置数据库
    db.init_app(app)
    # 配置Redis
    global redis_store
    redis_store = redis.StrictRedis(host=Config.REDIS_HOST, port=Config.REDIS_PORT)
    # 设置session 保存的位置
    Session(app)
    return app




97d171504b400d2a726d1fee53c7ec44f3b73558
<mask token>

<mask token>


def create_app(config_name):
    app = Flask(__name__)
    app.config.from_object(config_name)
    db.init_app(app)
    global redis_store
    redis_store = redis.StrictRedis(host=Config.REDIS_HOST, port=Config.
        REDIS_PORT)
    Session(app)
    return app

<mask token>
db = SQLAlchemy()
redis_store = None


def create_app(config_name):
    app = Flask(__name__)
    app.config.from_object(config_name)
    db.init_app(app)
    global redis_store
    redis_store = redis.StrictRedis(host=Config.REDIS_HOST, port=Config.
        REDIS_PORT)
    Session(app)
    return app

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_session import Session
from config import Config
import redis
db = SQLAlchemy()
redis_store = None


def create_app(config_name):
    app = Flask(__name__)
    app.config.from_object(config_name)
    db.init_app(app)
    global redis_store
    redis_store = redis.StrictRedis(host=Config.REDIS_HOST, port=Config.
        REDIS_PORT)
    Session(app)
    return app

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_session import Session
from config import Config
import redis


# 数据库
db = SQLAlchemy()
redis_store = None


# 通过传入的不同的配置名字，初始化其对应的应用实例
def create_app(config_name):
    # 创建app
    app = Flask(__name__)
    app.config.from_object(config_name)

    # 配置数据库
    db.init_app(app)
    # 配置Redis
    global redis_store
    redis_store = redis.StrictRedis(host=Config.REDIS_HOST, port=Config.REDIS_PORT)
    # 设置session 保存的位置
    Session(app)
    return app



