title: using the pycharm debugger with a flask application factory
body: <p>I am typing more print statements than code. It's killing me.</p>
  
  <p>If a flask development server is invoked via below, I can use PyCharm debugger</p>
  
  <pre><code>from ersapp import app
  
  if __name__ == '__main__':
      app.run(debug=True)
  </code></pre>
  
  <p>I am following the example in <a href="http://blog.miguelgrinberg.com/" rel="noreferrer">Miguel Grinberg's book</a> and an application manager (<a href="http://flask-script.readthedocs.org/en/latest/" rel="noreferrer">flask-script</a>) is used. I invoke the server in my application directory like below</p>
  
  <pre><code>(env)$ python manage.py runserver
  </code></pre>
  
  <p>and in <code>appdirectory/__init__.py</code></p>
  
  <pre><code>def create_app(config_name):
      webapp = Flask(__name__)
      ...
      return webapp
  </code></pre>
  
  <p>The debugger in Pycharm would make things easier since that's where I work.</p>