title: Issues with flask config usage. Having a KeyError when accessing a configuration item
body: <p>I have made sure I read all possible post about this but it seems something is still blurred to me. I am learning python by doing a project with flask. My folder structure is as shown below</p>
  
  <pre><code>/source
    /config
    __init__.py
    settings.py
    /classes
    __init__.py
    Dblayer.py
    /templates
    index.html
    test.html
  myapp.py
  </code></pre>
  
  <p>So in my app I am using the following</p>
  
  <pre><code>from flask import Flask, request, session, g, redirect, url_for, abort, render_template
  from classes import DbLayer
  
  app = Flask(__name__)
  app.config.from_pyfile("config/settings.py") # this is according to documentation...so I am confused
  
  
  @app.route('/')
  def index():
      return render_template("index.html")
  
  
  @app.route('/viewitems')
  def showitems():
      return render_template("test.html", db= app.config['host'])  
  </code></pre>
  
  <p>The content of settings.py is really simple:</p>
  
  <pre><code>database = "somedb"
  username = "someuser"
  password = "somepassword"
  host = "localhost"
  </code></pre>
  
  <p>I used test.html to see the usage of the configuration in flask and I am having a very annoying KeyError: 'host'. Is there anything that I am not doing well?</p>
  
  <p>Thanks </p>