title: Customization of modules, constants, and databases in a settings / config file for Flask
body: <p>I've been playing around with Flask for the past week. For fun, I'm trying to implement the following. Yes, I know it's very Django-esque, and perhaps inappropriate for a micro-framework.  </p>
  
  <p>Here is a sample of what I'm trying to do:</p>
  
  <pre><code>STATIC_PATH = '/static/'
  TEMPLATE_URL = '/template/'
  DATABASES = {
    'DEBUG': {
      'ENGINE': 'bla.sqlite3',
      'NAME': 'koopics.db'
    },
    'DEMO': {
      'ENGINE': 'bla.sqlite3',
      'NAME': 'somedb'
    },
    'PRODUCTION': {
      'ENGINE': 'bla.psycopg2',
      'NAME': 'somedb',
      'host': 'host',
      'username': 'host',
      'password': 'host',
    },
  }
  
  MODE = 'Demo'
  
  #TODO: put an IF statement here to provide  the connection mechanism for the db
  #      depending on what is required    
  
  INSTALLED_APPS = [
    'Flask-SQLAlchemy',
    'Flask-DebugToolbar',
    'Flask-Mail',
    'Flask-Cache',
    'Flask-Celery',
    'my_custom_module',
  ]
  </code></pre>
  
  <p>I currently have my custom apps defined in their own folder with <code>__init__.py</code>. </p>
  
  <p><strong>Question:</strong> Is it possible to get the DBs to work and have the "apps" loaded as part of settings and app.py? </p>