title: Access config values in Flask from other files
body: <p>I have the following app structure:</p>
  
  <pre><code>manage.py
  myapp/
    __init__.py
    config.py
    views/
      __init__.py
      login.py
      ...
  </code></pre>
  
  <p>In <code>myapp/__init__.py</code> I have a function <code>create_app()</code> which returns the Flask app instance. The config values are also stated in <code>create_app()</code> too. I would like to be able to access these values in other files such as <code>login.py</code>. I've tried:</p>
  
  <pre><code>from myapp import create_app as app
  print app.config['SECRET_KEY']
  </code></pre>
  
  <p>However I receive an error stating <code>AttributeError: 'function' object has no attribute 'config'</code></p>
  
  <p>What am I doing wrong and how can I fix this? Thanks.</p>