def app(): app = create_app() app.config['SECRET_KEY'] = config['TEST']['SECRET_KEY'] app.config['MFLIX_DB_URI'] = config['TEST']['MFLIX_DB_URI'] return app
from mflix.factory import create_app import os import configparser config = configparser.ConfigParser() config.read(os.path.abspath(os.path.join(".ini"))) if __name__ == "__main__": app = create_app() app.config['DEBUG'] = True app.config['MFLIX_DB_URI'] = config['PROD']['MFLIX_DB_URI'] app.config['MFLIX_NS'] = config['PROD']['MFLIX_NS'] app.config['SECRET_KEY'] = config['PROD']['SECRET_KEY'] app.run() #Trial only
from mflix.factory import create_app from flask.helpers import get_debug_flag from mflix.settings import DevConfig, ProdConfig CONFIG = DevConfig if get_debug_flag() else ProdConfig app = create_app(CONFIG)
def app(): app = create_app(config_object=TestConfig) return app
def app(): app = create_app() app.config["SECRET_KEY"] = config["TEST"]["SECRET_KEY"] app.config["MFLIX_NS"] = config["PROD"]["MFLIX_NS"] app.config["MFLIX_DB_URI"] = config["TEST"]["MFLIX_DB_URI"] return app