title: How to execute long requests
body: <p>I am working on building a gui/dashboard type of thing thru which I take input from user.. and when user press submits.. I gather response and fire a job in back end.
  What I am hoping to achive is..
  When the user press submits:
  and that long job is being processed, I show something like: "Your job has been submitted succesfully) submitted
  and when it is finished.. I refresh the page to take user to that page.</p>
  
  <p>Here is how my route.py snippet looks like</p>
  
  <pre><code>@app.route('/',methods=['POST'])
  def get_data():
      data = request.form
      for data_tuple in data:
  
              requests_to_gb[data_tuple] = data[data_tuple]
      flag = execute_request(requests_to_gb) &lt;---Fires a job
  
      if flag:
          flash("Your request has been submitted")
  
      else:
          flash("request could not be completed!")
      return render_template('request_submitted.html')
  </code></pre>
  
  <p>But the issue is.. that line where i execute_request() takes a long time to process.. and everything is halted until that is finished?
  How do I handle this?
  And how do i automatically refresh to new page as well?</p>