code: def create_app(object_name):
      
      app = Flask(__name__)
  
      app.config.from_object(object_name)
  
      # initialize the cache
      cache.init_app(app)
  
      # initialize the debug tool bar
      debug_toolbar.init_app(app)
  
      # initialize SQLAlchemy
      db.init_app(app)
  
      return app
docs: An flask application factory, as explained here:
      http://flask.pocoo.org/docs/patterns/appfactories/
  
      Arguments:
          object_name: the python path of the config object,
                       e.g. webapp.settings.ProdConfig
  
          env: The name of the current environment, e.g. prod or dev