title: Issue running Flask App: create_app app.config.from_object(app_config[config_name]) KeyError: None
body: <p>I downloaded a Flask project from GitHub. I'm trying to run the Flask project in a virtualenv, but when I run the project in virtualenv it's throwing the following error:</p>
  
  <blockquote>
    <p>none
    \app__init__.py", line 10, in create_app
        app.config.from_object(app_config[config_name])
    KeyError: None</p>
  </blockquote>
  
  <p><strong>&#95;&#95;init&#95;&#95;.py:</strong></p>
  
  <pre class="lang-python prettyprint-override"><code>from flask import Flask
  from config import app_config
  from flask_sqlalchemy import SQLAlchemy
  from flask_migrate import Migrate
  
  db = SQLAlchemy()
  
  def create_app(config_name):
      app = Flask(__name__, instance_relative_config=True)
      app.config.from_object(app_config[config_name])
      app.config.from_pyfile('config.py')
      db.init_app(app)
      migrate = Migrate(app, db)
      from app import models 
      from app.home import home as home_blueprint
      app.register_blueprint(home_blueprint)
      return app
  </code></pre>
  
  <p><strong>config.py:</strong></p>
  
  <pre><code>   class Config(object):
     class DevelopmentConfig(Config):
     DEBUG = True
     SQLALCHEMY_ECHO = True
     class ProductionConfig(Config):
     DEBUG = False
  
     app_config = {
          'development': DevelopmentConfig,
          'production': ProductionConfig
     }
  </code></pre>
  
  <p><strong>run.py:</strong> </p>
  
  <pre><code>    import os
      from app import create_app
      config_name = os.getenv('FLASK_CONFIG')
      app = create_app(config_name)
      if __name__ == '__main__':
       app.run()
  </code></pre>