title: Stuck with a Key Error from a flask tutorial
body: <p>My config.py:</p>
  
  <pre><code>OPENID_PROVIDERS = [
  { 'name': 'Google', 'url': 'https://www.google.com/accounts/o8/id' },
  { 'name': 'Yahoo', 'url': 'https://me.yahoo.com' },
  { 'name': 'AOL', 'url': 'http://openid.aol.com/&lt;username&gt;' },
  { 'name': 'Flickr', 'url': 'http://www.flickr.com/&lt;username&gt;' },
  { 'name': 'MyOpenID', 'url': 'https://www.myoopenid.com' }
  ]
  </code></pre>
  
  <p>Views.py:</p>
  
  <pre><code>@app.route('/login', methods=['GET', 'POST'])
  def login():
      form = LoginForm()
      if form.validate_on_submit():
          flash('Login requested for OpenID="' + form.openid.data
            + '", remember_me=' + str(form.remember_me.data))
          return redirect('/index')
      return render_template('login.html', 
          title='Sign In', 
          form=form,
          providers=app.config['OPENID_PROVIDERS'])
  </code></pre>
  
  <p>The tutorial lives <a href="http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-iii-web-forms" rel="nofollow">here</a></p>
  
  <p>Thanks for the help.</p>
  
  <hr>
  
  <p>My traceback :</p>
  
  <pre><code>    Traceback (most recent call last):
    File "/Users/biofobico/sites/env/microblog/lib/python2.7/site-packages/flask/app.py", line 1701, in __call__
      return self.wsgi_app(environ, start_response)
    File "/Users/biofobico/sites/env/microblog/lib/python2.7/site-packages/flask/app.py", line 1689, in wsgi_app
      response = self.make_response(self.handle_exception(e))
    File "/Users/biofobico/sites/env/microblog/lib/python2.7/site-packages/flask/app.py", line 1687, in wsgi_app
      response = self.full_dispatch_request()
    File "/Users/biofobico/sites/env/microblog/lib/python2.7/site-packages/flask/app.py", line 1360, in full_dispatch_request
      rv = self.handle_user_exception(e)
    File "/Users/biofobico/sites/env/microblog/lib/python2.7/site-packages/flask/app.py", line 1358, in full_dispatch_request
      rv = self.dispatch_request()
    File "/Users/biofobico/sites/env/microblog/lib/python2.7/site-packages/flask/app.py", line 1344, in dispatch_request
      return self.view_functions[rule.endpoint](**req.view_args)
    File "/Users/biofobico/Sites/env/microblog/app/views.py", line 32, in login
      providers=app.config['OPENID_PROVIDERS'])
  KeyError: 'OPENID_PROVIDERS'
  </code></pre>
  
  <p>login.html:</p>
  
  <pre><code>{% extends "base.html" %}
  
  {% block content %}
  &lt;script type="text/javascript"&gt;
  function set_openid(openid, pr)
  {
      u = openid.search('&lt;username&gt;')
      if (u != -1) {
          // openid requires a username
          user = prompt('Enter your ' + pr + ' username:')
          openid = openid.substr(0, u) + user
      }
      form = document.forms['login'];
      form.elements['openid'].value = openid
  }
  &lt;/script&gt;
  &lt;h1&gt;Sign in&lt;/h1&gt;
  &lt;form action="" method="post" name="login"&gt;
      {{ form.hidden_tag() }}
      &lt;p&gt;
          Please enter your OpenID:&lt;br&gt;
          {{ form.openid(size=80) }}&lt;br&gt;
          {% for error in form.errors.openid %}
          &lt;span style="color: red;"&gt;[{{error}}]&lt;/span&gt;
          {% endfor %}
          |{% for pr in providers %}
          &lt;a href="javascript:set_openid('{{pr.url}}', '{{pr.name}}');"&gt;{{pr.name}}&lt;/a&gt; |
          {% endfor %}
      &lt;/p&gt;
      &lt;p&gt;{{ form.remember_me }} Remember Me&lt;/p&gt;
      &lt;p&gt;&lt;input type="submit" name="" value="Sign In"&gt;&lt;/p&gt;
  &lt;/form&gt;
  {% endblock content %}
  </code></pre>
  
  <p>Thanks in advance</p>