title: Python Flask, Restarting with reloader: What does that mean
body: <p>I am trying to build y first webservice using Python Flask. I am not able to understand what does it mean for Flask to emit out Restarting with reloader, every time i run my app.</p>
  
  <p>This is my code.</p>
  
  <pre><code>#!venv/bin/python
  from flask import Flask
  from flask import request
  
  
  def buildCache():
      print 'Hello World'
  
  buildCache()
  
  app = Flask(__name__)
  
  
  @app.route('/search')
  def index():
      query = request.args.get('query','', type=str);
      return  query
  
  
  if __name__ == '__main__':
      app.run(debug = True)
  </code></pre>
  
  <p>when i run it </p>
  
  <pre><code>venv/bin/python ./app.py
  Hello World
   * Running on http://127.0.0.1:5000/
   * Restarting with reloader
  Hello World
  </code></pre>
  
  <p>I dont understand why buildCache method is being called twice? It seems to be related to "Restarting with the reoloader', what does that mean? How do i make sure that buildCache is only executed once, before the server starts.</p>