title: Reading properties from config file with Flask and Python
body: <p>Building from <a href="https://stackoverflow.com/questions/50415433/reading-config-file-as-dictionary-in-flask">Reading config file as dictionary in Flask</a> I'm attempting to define a custom configuration file in order to customize my Flask app.</p>
  
  <p>Running code : </p>
  
  <pre><code>from flask import Flask
  app = Flask(__name__)
  
  import os
  
  my_config = app.config.from_pyfile(os.path.join('.', 'config/app.conf'), silent=False)
  
  @app.route('/')
  def hello_world():
  
      with app.open_instance_resource('app.cfg') as f:
          print(type(f.read()))
  
      return 'Hello World! {}'.format(app.config.get('LOGGING'))
  
  if __name__ == '__main__':
      app.run()
  </code></pre>
  
  <p>In config/app.conf these properties are added : </p>
  
  <pre><code>myvar1="tester"
  myvar2="tester"
  myvar3="tester"
  </code></pre>
  
  <p>Invoking the service for <code>hello_world()</code> function returns : </p>
  
  <pre><code>Hello World! None
  </code></pre>
  
  <p>Shouldn't the contents of the file be returned instead of None ?</p>
  
  <p>I attempt to access a property using <code>app.config.get('myvar1')</code> but <code>None</code> is also returned in this case.</p>