# Module that initialises and runs the app from flask import Flask # factory function to create application instance def create_app(config_key): # create Flask app instance app = Flask(__name__) # get config settings based on config_key (subclass of # Config class, e.g TestingConfig; # ProductionConfig, ...) in config dict of config.py file from config import config # I NOTICE THE PROBLEM OCCURS ON THIS LINE app.config.from_object(config[config_key]) # Call init_app method config[config_key].init_app(app, [bootstrap, db]) # ... return app